RE: Masks in an ImageList (Jeremy White)

> Message: 1
> From: "Jeremy White" <[EMAIL PROTECTED]>
> To: perl-win32-gui-users@lists.sourceforge.net
> Date: Tue, 06 May 2003 08:16:21 +0000
> Subject: [perl-win32-gui-users] Masks in an ImageList
>
> I have an image list that I’m using in a treeview and in a
> tabstrip. I need
> to use masks but I cannot work out what I’m meant to do?

When creating the imaglist, set FLAGS to '1':

  $im_list = new Win32::GUI::ImageList(16, 16, 1, 4, 7);
                                               ^

Then, for each icon create a second BMP file (the mask), where white will be
transparent and any colored pixel will be filled with the underlying pixel
of the original icon (often you can use the same bitmap twice - unless you
really want to display white in it). Also you can set the color depth of the
mask-bitmap to 1-bit (only Black & white) in your picture-editor to save
disc-space.

Then,when adding the images supply the second (mask) bitmap as mask:

  $im_list->Add ("original.bmp", "masked.bmp");

And take a look!

Roelof


Reply via email to