best way to do bit masking in winforms

  • Thread starter Thread starter not_a_commie
  • Start date Start date
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?
 
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
 
Back
Top