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. Bitmap transparency at picture_control [modified]

Bitmap transparency at picture_control [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
visual-studiocsharpgraphicsquestion
5 Posts 4 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.
  • J Offline
    J Offline
    Jarley D G
    wrote on last edited by
    #1

    Hello I´m inserting a bitmap image in my dialog with a picture control, and i want it to be transparent like when you insert an icon in a dialog, and you set the background colour to some kind of green at visual studio icon editor and it do the trick. So, what background color should I use with bitmaps? btw I´m using Visual Studio 2003 IDE. thank´s. -- modified at 8:53 Thursday 24th August, 2006

    K W J 3 Replies Last reply
    0
    • J Jarley D G

      Hello I´m inserting a bitmap image in my dialog with a picture control, and i want it to be transparent like when you insert an icon in a dialog, and you set the background colour to some kind of green at visual studio icon editor and it do the trick. So, what background color should I use with bitmaps? btw I´m using Visual Studio 2003 IDE. thank´s. -- modified at 8:53 Thursday 24th August, 2006

      K Offline
      K Offline
      KarstenK
      wrote on last edited by
      #2

      This is a little work: http://www.codeproject.com/staticctrl/LayeredBitmapCtrl1.asp or look yourself for "transparent"

      Greetings from Germany

      1 Reply Last reply
      0
      • J Jarley D G

        Hello I´m inserting a bitmap image in my dialog with a picture control, and i want it to be transparent like when you insert an icon in a dialog, and you set the background colour to some kind of green at visual studio icon editor and it do the trick. So, what background color should I use with bitmaps? btw I´m using Visual Studio 2003 IDE. thank´s. -- modified at 8:53 Thursday 24th August, 2006

        W Offline
        W Offline
        Waldermort
        wrote on last edited by
        #3

        There ia a GDI function called TransparentBlt(), but it is not very good. The best approach is to use two bitmaps. The first should be black in all areas you want transparent and white in all other areas. The secon, your picture, should be white in all areas you want transparent. You draw these two over the top of each other. The fist bitmap using BitBlt() with SRCAND, the second using BitBlt with SRCPAINT. The result is a transparent bitmap.

        1 Reply Last reply
        0
        • J Jarley D G

          Hello I´m inserting a bitmap image in my dialog with a picture control, and i want it to be transparent like when you insert an icon in a dialog, and you set the background colour to some kind of green at visual studio icon editor and it do the trick. So, what background color should I use with bitmaps? btw I´m using Visual Studio 2003 IDE. thank´s. -- modified at 8:53 Thursday 24th August, 2006

          J Offline
          J Offline
          Justin Tay
          wrote on last edited by
          #4

          Actually, the easiest possible way of doing this is probably by just using an ImageList to draw your bitmap, specifying a mask color.

          J 1 Reply Last reply
          0
          • J Justin Tay

            Actually, the easiest possible way of doing this is probably by just using an ImageList to draw your bitmap, specifying a mask color.

            J Offline
            J Offline
            Jarley D G
            wrote on last edited by
            #5

            ok thanks all, i will try all the methods, and read the site as well.. thx..

            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