In order to use an image list with masks the flag "ILC_MASK" must be set in the call to ImageList_Create, Otherwise the image list contains only one bitmap. Also, To properly display your 16 color bitmaps I had to also include "ILC_COLOR16".
See the MS Doc here for more: ImageList_Create
Note: Win32::GUI::ImageList->new essentially just calls Win32::GUI::ImageList::Create(@_) in GUI.pm which maps to ImageList_Create(cx, cy, flags, cInitial, cGrow) in GUI.xs. So, to set the flags the MS Win32 API wants just supply them to the constructor.
I also updated the files and links in my orignal reply: Re: Win32::GUI::TreeView and bitmap masks.# NOTE: To use bitmap masks, the flag ILC_MASK (0x0001) must be set. # Also, using a 16 color bmp seem to require ILC_COLOR16 (0x0010) my $il = Win32::GUI::ImageList->new(16, 16, 0x0011, 4, 5); # This Will NOW use masked BMP images $il->Add('FolderOpen.bmp', 'FolderOpenMask.bmp'); $il->Add('FolderClosed.bmp', 'FolderClosedMask.bmp');
I hope this works better ;-)
In reply to Re: Re2: Win32::GUI::TreeView and bitmap masks
by knexus
in thread Win32::GUI::TreeView and bitmap masks
by bbfu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |