Access the answers to your technology questions today.
Subscribe Now
30-day free trial. Register in 60 seconds.
What Makes Experts Exchange Unique?
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.
Try it out and discover for yourself.
Subscribe Now
30-day free trial. Register in 60 seconds.
Join the Community
Give a Little. Get a Lot.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Join the Community
by: FentonEngPosted on 2008-09-11 at 11:16:28ID: 22452822
If you have the RGBA data in memory, then simply write a 1 or 0 into a boolean array depending on the value in the alpha channel (eg. 0 for 0 alpha, 1 for everything else)
om/en-us/l ibrary/ms5 32305(VS.8 5).aspx
m the top of my head, a good way would be to scan 8 pixels (alpha channels) at a time and build a byte from the results, rather than having a bool array and packing later on. You could even do the whole thing with simple shift operations!
This can then be packed into bytes and written to a bitmap using either your own function or a Win32 library function such as:
http://msdn.microsoft.c
Fro
Once you have that sorted, you could speed up your routine by handling 32 pixels at a time and writing 4-byte unsigned integers to the bitmap.
Unless I have mis-understood your question...