This topic shows you how to use CBitmapContext::Clear()
to clear a rectangle to the current brush color.
TRect largeBox(0,0,100,100); TRect clearBox(20,20,40,40); // draw a cross-hatched box gc.SetBrushColor(KRgbDarkGray); gc.SetBrushStyle(CGraphicsContext::ESquareCrossHatchBrush); gc.DrawRect(largeBox); // clear a small rectangle gc.SetBrushColor(KRgbGray); // change the brush color gc.Clear(clearBox); // clear to brush color
Note: When clearing a rectangle, the brush style is ignored, even if it is TBrushStyle::ENullBrush
.