Transparency and Bitmap.GetHBitmap method

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm trying to develop a COM interface in C# that would provide a bitmap
handle. In that DLL i do have a Bitmap object and i'm using the GetHbitmap
method to create a new similar bitmap and get its handle.

Everything seems to work well, except when there is some transparent zones
in the bitmap, the transparency color is changed in blue (default) right
after calling the GetHBitmap method.

Is there any way to avoid having the transparent color changed to blue ?

thx for any help.
 
AFAIK GetHBitmap creates a 24bpp image internally so you'll lose all the
alpha information.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top