| |
|
|
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
|
|
|
| |
|
|