Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CImageList when .draw -> no more transparent

CImageList when .draw -> no more transparent

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsquestionlearning
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    karhong
    wrote on last edited by
    #1

    Hi, I'm loading resource>toolbar into CImageList When i draw using imageList.draw, then the transparent is no more work any idea? CImageList ImgList; COLORREF rgbTransparentColor = RGB(73,73,73);//dono what this use.. CBitmap bmp; int bubu = bmp.LoadBitmapW(IDR_MAINFRAME);//the toolbar to be loaded ImgList.Create(16.5,14.5,ILC_MASK | ILC_COLOR32,1,1); ImgList.Add(&bmp, rgbTransparentColor);//put the bitmap into imagelist CPoint ptImage(rectIcon.left + 1, rectIcon.top + 1);//get the point(position) of the rectangle to be drawn ImgList.Draw(pDC, nIconPosi, ptImage, ILD_NORMAL);//draw the icon

    good

    N 1 Reply Last reply
    0
    • K karhong

      Hi, I'm loading resource>toolbar into CImageList When i draw using imageList.draw, then the transparent is no more work any idea? CImageList ImgList; COLORREF rgbTransparentColor = RGB(73,73,73);//dono what this use.. CBitmap bmp; int bubu = bmp.LoadBitmapW(IDR_MAINFRAME);//the toolbar to be loaded ImgList.Create(16.5,14.5,ILC_MASK | ILC_COLOR32,1,1); ImgList.Add(&bmp, rgbTransparentColor);//put the bitmap into imagelist CPoint ptImage(rectIcon.left + 1, rectIcon.top + 1);//get the point(position) of the rectangle to be drawn ImgList.Draw(pDC, nIconPosi, ptImage, ILD_NORMAL);//draw the icon

      good

      N Offline
      N Offline
      Naveen
      wrote on last edited by
      #2

      karhong wrote:

      RGB(73,73,73);//

      Is this the color in the bitmap that you want to make transperent?

      nave [OpenedFileFinder] [My Blog]

      K 1 Reply Last reply
      0
      • N Naveen

        karhong wrote:

        RGB(73,73,73);//

        Is this the color in the bitmap that you want to make transperent?

        nave [OpenedFileFinder] [My Blog]

        K Offline
        K Offline
        karhong
        wrote on last edited by
        #3

        yea.. i hope to make the imgList.Draw icons to have the background color of RGB(73,73,73)

        good

        I 1 Reply Last reply
        0
        • K karhong

          yea.. i hope to make the imgList.Draw icons to have the background color of RGB(73,73,73)

          good

          I Offline
          I Offline
          Iain Clarke Warrior Programmer
          wrote on last edited by
          #4

          Either I am misunderstanding you, or you are misunderstanding the API. The transparent colour is the colour in the original bitmap that you want to become transparent. I normally use a hideous shade of purple, or pink. I'm too manly to use them for actual display. There is nothing stopping you using a certain shade of gray (RGB(73,73,73)), but it will be less obvious when you are editing the original bitmap. For debugging the sort of problem you have, I strongly recommend the excellent article http://www.codeproject.com/KB/applications/imageviewer.aspx[^] by PJ Arends. Iain.

          Codeproject MVP for C++, I can't believe it's for my lounge posts...

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups