Bitmap transparency at picture_control [modified]
-
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
-
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
This is a little work: http://www.codeproject.com/staticctrl/LayeredBitmapCtrl1.asp or look yourself for "transparent"
Greetings from Germany
-
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
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 usingBitBlt()
withSRCAND
, the second using BitBlt withSRCPAINT
. The result is a transparent bitmap. -
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
Actually, the easiest possible way of doing this is probably by just using an ImageList to draw your bitmap, specifying a mask color.
-
Actually, the easiest possible way of doing this is probably by just using an ImageList to draw your bitmap, specifying a mask color.
ok thanks all, i will try all the methods, and read the site as well.. thx..