|
Jochen,
> probably I am wrong, but somehow I remember I read something about a
feature
> that allows one bmp strip of images (e.g. 160x16 pixels gives 10 16x16
> icons) to be loaded. Can't find the doc anymore; does someone know about
> this feature?
In Dolphin this technique is often used for the images displayed on
ToolbarButtons. All the images are added to one large bitmap and when the
Toolbar is designed you specify the Bitmap and the offset (0 based) for the
image you want. The first image (0@0 to 15@15) is index 0, the second
(16@0 to 31@15) is index 1 etc.
It appears that you can also do this outside of the Toolbar (I assume
Toolbars use the same functionality) but it's not something I've ever used.
However, I tried the following test and it seems to work....
Create a bitmap containing n 16x16 bitmaps. Evaluate ...
x := WinImageList newExtent:16@16.
x addBitmap: (Bitmap fromFile: 'x.bmp').
The WinImageList breaks down the big bitmap into separate images.
Evaluating
x getImageCount
should answer the correct number of separate images. You can convert each
one to an Icon by specifying its (0 based) offset...
x getIcon: anImageOffset style: 0
I don't know what the style argument does but a search on MSDN online should
shed some light.
Regards
Ian
|