Click here to Skip to main content
15,892,965 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using SetDIBitsToDevice to write the pixel array (containing the RGB value) to picture box.
Its happening, How can I use Alpha value for draw the transparent pixel in the same?
Posted

1 solution

Please use GDI+ to use Alpha channel of the bitmap.

If you need to get semi transparent display of an image, AlphaBlend() will help you.
Perpixel Alpha blending will be difficult.

Following links will help to achieve alpha blending of the entire image while drawing to screen.
Using the AlphaBlend function[^]

http://msdn.microsoft.com/en-us/library/windows/desktop/dd183353(v=vs.85).aspx[^]
 
Share this answer
 
Comments
Rajeshkumar Ramasamy 3-Jun-13 8:07am    
Alpha Blend function apply the transparency to all pixels. What i want is, I have the pixel array containing the RGBA (RGB and Alpha)values consequently. I want to apply the alpha value for each pixel.
For that I am using BITMAPV4HEADER and SetDIBitsToDevice function to draw the pixel array into picture box. But the Alpha value is not working (RGB is working fine).
How can i use alpha value??

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900