Update: Ok, after wiping the egg off my face, I believe I have the answer now.

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.

# 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 also updated the files and links in my orignal reply: Re: Win32::GUI::TreeView and bitmap masks.

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.