English
Source / code snippets

ICO amount Size detect Icon

 

Jörg
Sellmeyer
here's one code, the one with The Number of Icongrößen in a ico-File detect can. Also go The Formate outputted and the jeweiligen Icons extract and on one Button outputted.
One dazugehöriges Icon:

Download


 $H windows.ph

Proc IconGetFormat

    Parameters Icon$
    Var Datei& = Assign(Icon$)
    Case FileSize(Icon$) < 10:Return 0
    OpenRW Datei&
    Seek Datei&,2
    Var type% = GetByte(Datei&)
    Close Datei&
    Return type%

ENDPROC

Proc IconFormatCount

    Parameters Icon$
    Case FileSize(Icon$) < 10:Return 0
    Var Datei& = Assign(Icon$)
    OpenRW Datei&
    Seek Datei&,4
    Var amount% = GetByte(Datei&)
    Close Datei&
    Return amount%

ENDPROC

Proc IconGetSize

    Parameters Icon$,index%
    Var Datei& = Assign(Icon$)
    OpenRW Datei&
    Seek Datei&,6 + index% * 16
    Var Size%[] = GetByte(Datei&),GetByte(Datei&)

    If Size%[0] = 0

        Clear Size%[]
        Seek Datei&,FilePos(Datei&)+1
        Size%[0] = GetWord(Datei&)
        Size%[1] = Size%[0]

    EndIf

    Close Datei&
    Return Size%[]

ENDPROC

Window 500,800
Declare Icon&,Icons&[],amount%,size%,y%,size%[]
Var Ico$ ="PRF-File.ico"
Print Ico$
Print "Typ = ";IconGetFormat(ico$),"(1 = Icon, 2 = Cursor, 0 = uncharted)"
Print "Anzahl = ";IconFormatCount(ico$)

WhileLoop 0,IconFormatCount(ico$)-1

    size%[] = IconGetSize(ico$,&Loop)
    Icons&[&Loop] = size%[0]
    Print "Icon",&Loop+1, "=",  size%[0] ,"x",  size%[1]

Wend

size% = 16
y% = 40

WhileLoop 0,SizeOf(Icons&[])-1

    Size% = Icons&[&Loop]
    Icon& = ~LoadImage(0,ico$,~IMAGE_ICON,size%,size%,~LR_LOADFROMFILE)
    Inc amount%
    Icons&[&Loop] = Icon&
    Create("IconButton",%hwnd,Icon&,160,y%,Size% + 10,Size% + 10)
    Inc y%, size% + 20
    Inc size%,2

Wend

Waitinput

WhileLoop 0,SizeOf(Icons&[])-1

    DeleteObject Icons&[&Loop]

Wend

End
ICONDIRENTRY

348 kB
Hochgeladen:06/25/18
Downloadcounter274
Download
 
XProfan X4
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
06/25/18  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

2.633 Views

Untitledvor 0 min.
Stringray01/05/22
p.specht12/10/20
Rolf Koch09/06/20
Jörg Sellmeyer06/05/20
More...

Themeninformationen

this Topic has 1 subscriber:

Jörg Sellmeyer (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie