best way to do bit masking in winforms

N

not_a_commie

I need to draw (GDI+) rectangles that don't actually overwrite the
background (aka, what was already drawn to the Graphics object) if the
background is approximately black. What is the most efficient way to
do this? I can build up a Region checking each individual pixel
whenever my background image changes. I can then use sub-portions of
this region in my paint method. However, this seems kludgy to me. Any
better options?
 
B

Ben Voigt [C++ MVP]

Can you possibly use GDI for this, which has raster operation codes? In
this case using AND might have the desired effect.

not_a_commie said:
I need to draw (GDI+) rectangles that don't actually overwrite the
background (aka, what was already drawn to the Graphics object) if the
background is approximately black. What is the most efficient way to
do this? I can build up a Region checking each individual pixel
whenever my background image changes. I can then use sub-portions of
this region in my paint method. However, this seems kludgy to me. Any
better options?

__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4160 (20090616) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4160 (20090616) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 

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

Top