Visual Studio 2005 MFC C++ how do to Transparency Color on existing images?

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
We have a large Visual Studio 2005 MFC C++ Application Program with images on the Main Form Dialog.

We are using 12 by 12 pixel images and 32 by 32 pixel images to indicate certain conditions at the appropriate times.

We have about 7 images that need to have transparency color applied to them. They are currently using "Bitmaps" tied to those PictureBoxes on the Main Form Dialog via the resources of the program so that the images dont have to be loaded at runtime.

At this point in time, we need to convert the color "white" in these images to be used as the Transparency Color.

We are trying to not use Icon Files so that we have the full color spectrum on the images.

Currently using "True Color" setting in VS2005 from Bitmap Images.

We have tried converting one image to an Icon File then imported it... We are very dissatisfied colors when it was converted into an icon but the transparency part of things works well on the Form Dialog... didnt like the fact that the image had to be resized from 12 x 12 pixels to 16 x 16 pixels.

We just added a "skins" to our project from a 3rd party company and those look great.

But now we need to use the Transparency Color to make the Form look clean without the excess "white" around the images.

Have seen some example code on the Internet but those properties arent available when we try adding in that code into our application.

Found an article via a Microsofts site but the article mentions Visual Studio 2005 for doing what we need to do but it is quite obvious that the stuff shown there is from Visual Studio 6 or previous version of Visual Studio... so that link is totally useless:
http://msdn.microsoft.com/en-us/library/xf389s62(v=vs.80).aspx
* The option mentioned isnt even available when the image is being edited!

Looked at this link:
http://www.codeguru.com/csharp/.net/net_general/graphics/article.php/c4661/Converting-a-Bitmap-to-Have-a-Transparent-Background.htm

---
Bitmap Logo = new Bitmap(CompanyLogo.Image);
Logo->MakeTransparent(Logo.GetPixel(1, 1)); // <- Intellisense will not allow this at all!

CompanyLogo.Image = (Image) Logo;
---

YES, I already know that the article above is about .Net!

What we are attempting to do would be something similar to what is shown in that article.

Surely this isnt a difficult thing to do.

Thanks,
BillNew
DirectShow Filter Graph Spy: http://alax.info/blog/777 Extremely helpful for finding deep details for DirectShow Graphs.

View the full article
 
Back
Top