CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2003
    Posts
    2

    ImageList_AddMasked() Question

    I'm trying to add icons to the tab strip in my program. If I use ImageList_Add() everything works out fine. But I'm trying to get a transparent color to work. The color that I set for transparent ends up turning black in the app. I've tried several different colors and all of them end up black in the app. I'm pretty sure that I'm doing InageList_Create right.

    HIMAGELIST himgl = ImageList_Create(80,
    16,
    ILC_COLOR8|ILC_MASK,
    0,
    0);

    I've even tried changing the color depth and I still have no luck. Any suggestions on getting some transparent bitmaps?

  2. #2
    Join Date
    Nov 2002
    Location
    Israel
    Posts
    182
    I tried it for the lict control and that worked:
    ImageList_AddMasked(hImageList, hBitmap, clrTransparent)

    The image list was created so:
    HIMAGELIST hImages = ImageList_Create(16, 16, ILC_COLORDDB | ILC_MASK, 1, 3);
    And then I don't remember why I wrote the following:
    ImageList_SetBkColor(hImages, CLR_NONE);
    Good luck

  3. #3
    Join Date
    May 2003
    Posts
    2
    My problem was I was using the wrong flag. I was loading the images as DIBs but in my call to ImageList_Create I was stating them as 8bit color bitmaps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured