tags:

views:

61

answers:

1

I know you can programmatically determine the tranparency color of a .gif

Is there a way to do the same for a Bitmap?

Right now, I am doing this heuristically by sampling around the outer edge but of course this is not 100% reliable.

+4  A: 

I don't believe the BMP file format supports the concept of transparency. My understanding is that if BMP images are used with transparency, it's using an application-defined colour, like RGB(255,0,255) to specify transparent areas.

Jason Musgrove
Correct. Sometimes applications will use the first pixel of a bitmap to designate the transparent color such as Magenta. But this is entirely up to the application as to how it wants to mask the bitmap.
Josh Einstein
+1 Yeah, that's the conclusion I came to. Just hoping that there is a hole in my reasoning. Will leave it open for a while.
Sky Sanders
I believe there is some support for a bmpx format that saves the Alpha channel but @Jason and @Josh are absolutely correct for straight bitmap.
Lazarus