Hallöle,
weil ich mich aktuell grad ein wenig damit beschäftigt hab, hier ein kleines Abfallprodukt, das ich als Hilfsmittel fix gebastelt hab, damit ich die Profan-Ressourcen besser plündern kann ![]()
Die Nummern entsprechen also dem Index, mit dem das Bild/Icon letztendlich extrahiert werden kann.
Vllt. hilft es ja den einen oder anderen...
Code
Declare hIL&, hBMP&,xp&,yp&,bz&,br&
WindowStyle 31
Window 1000,650
'BilderListe für Icons 16x16:
UseFont "courier new",20,10,1,0,0
DrawText 35,5, "Profan Bitmap-Ressource 'TOOLBAR' (16x16):"
hBmp& = create("hPic", 0, "TOOLBAR") 'die toolbar-icons aus der profanruntime in eine bitmap schreiben
hIL& = Create("ImageList", 16, 16, hBMP&, rgb(192, 192, 192)) '
DeleteObject hBmp& 'wird nicht mehr benötigt, weil in imagelist kopiert wurde
UseFont "courier new",16,8,0,0,0
xp& = 0 'startpos. bild waagerecht
yp& = 30 'startpos. senkrecht
bz& = 0 'bildzähler
br& = 20
WhileLoop 0, GetCount(hIL&) - 1
Inc bz& 'bild hochzählen
Inc xp&,35 'pos. des nächsten bildes
DrawText xp&,yp&,Str$(&loop)
DrawIcon hIL&,&loop, xp&,yp& + 17
If bz& = br& 'wenn bildreihe voll ist
Clear bz&, xp& 'bildzähler + x-bildpos. resetten
Inc yp&,45 'y-pos. der nächsten Bildreihe
EndIf
EndWhile
DeleteObject hIL& 'imagelist wird nicht mehr benötigt, weil icons extrahiert wurden
'BilderListe für Icons 32x32:
UseFont "courier new",20,10,1,0,0
DrawText 30,yp& + 60, "Profan Bitmap-Ressource 'TOOLBAR32' (32x32):"
hBmp& = create("hPic", 0, "TOOLBAR32") 'die toolbar-icons aus der profanruntime in eine bitmap schreiben
hIL& = Create("ImageList", 32, 32, hBMP&, rgb(192, 192, 192)) '
DeleteObject hBmp& 'wird nicht mehr benötigt, weil in imagelist kopiert wurde
UseFont "courier new",16,8,0,0,0
xp& = -30 'startpos. bild waagerecht
yp& = yp& + 85 'startpos. senkrecht
bz& = 0 'bildzähler
br& = 16
WhileLoop 0, GetCount(hIL&) - 1
Inc bz& 'bild hochzählen
Inc xp&,60 'pos. des nächsten bildes
DrawText xp&,yp&,Str$(&loop)
DrawIcon hIL&,&loop, xp&,yp& + 17
If bz& = br& 'wenn bildreihe voll ist
Clear bz& ' bildzähler resetten
xp& = -30 'x-bildpos.resetten
Inc yp&,70 'y-pos. der nächsten Bildreihe
EndIf
EndWhile
DeleteObject hIL& 'imagelist wird nicht mehr benötigt, weil icons extrahiert wurden
UseFont "courier new",20,10,1,0,0
DrawText 25,yp& + 65, "Taste = Ende"
WaitKey
End
Alles anzeigen