I want to replace all pixels in a rectangular region of a Bitmap with ‘transparent white’ – i.e., a=0, b=255, r=255, g=255.
FillRectangle doesnt do this – given a transparent brush, the existing pixels are unchanged.
Do I need to use SetPixel individually for each pixel in the rectangle?
You’ll have to set the
Graphics.CompositingModeproperty. For example:The actual color you use doesn’t matter, you’ll get a black rectangle with an alpha of 0.