Re: alpha channel
- From: "Chris Becke" <chris.becke@xxxxxxxxx>
- Date: Fri, 14 Sep 2007 09:29:51 +0200
1) Save the bitmap uncompressed(i.e., BI_RGB) with the alpha channel
pre-multiplied against the other three color channels.
Unfortunately, it seems that BMP files saved by tools such as Paintshop or
Adobe photoshop do not save with pre-multiplied data.
Ive never seen an offiical word from MS, but it seems standard that BMP
files are not pre-multiplied.
"Michael Phillips, Jr." <mphillips53@xxxxxxxxxxxxxxx> wrote in message
news:eIzhoLk9HHA.5980@xxxxxxxxxxxxxxxxxxxxxxx
How can i get rid of this grey color and change it transparent alpha
channel?
Assuming that you wish to save this bitmap as 32bpp, you would need to
mark each grey color pixel as transparent by setting the alpha byte to 0.
Each opaque pixel should be marked as opaque with 0xff(i.e., 255) in the
apha channel byte.
You have two choices to save as a bitmap:
1) Save the bitmap uncompressed(i.e., BI_RGB) with the alpha channel
pre-multiplied against the other three color channels.
2) Save the bitmap with version 5.0 of the BITMAPINFOHEADER(i.e.,
BITMAPV5HEADER) which allows you to specify masks for the ARGB channels.
Using gdiplus allows you to set the alpha channel all at once with a
ColorMatrix. If you do not want to use gdiplus, then you must do the work
yourself in a loop for each scanline and each ARGB pixel.
If you do not want to do any work at all, then simply save the bitmap and
display it with MaskBlt or BitBlt. You would define the grey color as
transparent and create XOR color and AND mask for display purposes.
"Peter Lakatos" <news@xxxxxxx> wrote in message
news:OM80Q4j9HHA.5360@xxxxxxxxxxxxxxxxxxxxxxx
Hi,
i can create bitmaps with transparency, and with BitBlt they appear
transparent on my application.
In my case, i have a white Bitmap with a red box. i can create a
transparent Bitmap
out of it, and on the grey CDC there appears a red box.
But how can i get the Transparent Bitmap out of my CDC ?
I already was able to create a Bitmap out of the CDC but it always show
the grey background of the application with a red box.
How can i get rid of this grey color and change it transparent alpha
channel ?
Thank you all
.
- Follow-Ups:
- Re: alpha channel
- From: Michael Phillips, Jr.
- Re: alpha channel
- References:
- alpha channel
- From: Peter Lakatos
- Re: alpha channel
- From: Michael Phillips, Jr.
- alpha channel
- Prev by Date: Re: alpha channel
- Next by Date: Re: alpha channel
- Previous by thread: Re: alpha channel
- Next by thread: Re: alpha channel
- Index(es):
Relevant Pages
|