No announcement yet.

Treeview OverlayImage

  • Filter
  • Time
  • Show
Clear All
new posts

  • Treeview OverlayImage

    Hi there,
    I'm lost here with this and hope I can get help from the experts.
    I try to change treeview images with the overlay image feature but
    it don't work for me.

    Here's a code snippet.
    '## some initializiations
    hImage = ImageList_Create(16, 16, %ILC_COLOR4, 4, 0)
    ImageList_Add hImage, LoadImage(hInst, "cfldr", %IMAGE_BITMAP, 0, 0, %LR_DEFAULTSIZE), 0 'index 0
    ImageList_Add hImage, LoadImage(hInst, "ofldr", %IMAGE_BITMAP, 0, 0, %LR_DEFAULTSIZE), 0 'index 1
    ImageList_Add hImage, LoadImage(hInst, "file", %IMAGE_BITMAP, 0, 0, %LR_DEFAULTSIZE), 0 'index 2
    ImageList_Add hImage, LoadImage(hInst, "sfull", %IMAGE_BITMAP, 0, 0, %LR_DEFAULTSIZE), 0 'index 3

    ImageList_SetOverlayImage hImage, 3, 1
    SendMessage hTree, %TVM_SETIMAGELIST, %TVSIL_NORMAL, hImage

    '## try to set the overlay image here
    pItem.hItem = TreeView_GetSelection(hTree)
    pItem.mask = %TVIF_HANDLE OR %TVIF_STATE
    pItem.statemask = %TVIS_OVERLAYMASK
    pItem.state = INDEXTOOVERLAYMASK(1)
    TreeView_SetItem hTree, pItem

    Images are all in the resource as well so thats not the problem. As you
    can see I select the 4(3) Image from the Image list as an overlay
    image and set it to overlaymask 1.
    Oh, this is PBDLL 6.0 I'm working with.

    Any comments will help
    Many thanks ahead.
    Thomas Noelker

    [email protected]

  • #2

    Until one of the experts swings by, the problem may be due to the imagelist creation call
      hImage = ImageList_Create(16, 16, %ILC_COLOR4, 4, 0)
    - your final parameter specifies that the imagelist isn't allowed to grow, which it will
    need to do, to accommodate the overlay image. Try -
      hImage = ImageList_Create(16, 16, %ILC_COLOR4, 4, %TRUE)
    See if that does it. I've not used overlay images, and can't stop to test this at the
    moment. Good luck !


    mailto[email protected][email protected]</A>
    Zippety Software, Home of the Lynx Project Explorer
    My e-mail


    • #3
      thanks for your help but thats not it. I figured out that when
      ever overlay images are needed that the image list needs to be
      initialized with the %ILC_MASK flag too and in addition each image
      should have a mask to be drawn correctly. But not just that. The
      images that are needed as overlay images need to be added via
      ImageList_AddMasked hImage, <img>, RGB(255, 255, 255)
      Only then it works setting overlay images with INDEXTOOVERLAYMASK bla bla.
      This took me now almost a week - hell.
      Your comment gave me an idea to look in the right spot.

      Thank you anyways

      [email protected]