Declare hIL&, hBMP&,xp&,yp&,bz&,br&
WindowStyle 31
Window 750,300
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 'bilder pro reihe
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
If (Val(SubStr$($profver,1,".")) > 11) Or (SubStr$($profver,2,"-") <> "NT") 'profanversion höher 11 oder FreeProfan?
Window 1000,650 'hurtig fenster größer machen
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
inc yp&,85 'startpos. senkrecht
bz& = 0 'bildzähler
br& = 16 'bilder pro reihe
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
EndIf
UseFont "courier new",20,10,1,0,0
DrawText 25,yp& + 65, "Taste = Ende"
WaitKey
End
Alles anzeigen