Export (0) Print
Expand All
Expand Minimize
1 out of 1 rated this helpful - Rate this topic

CDC::FillSolidRect

Call this member function to fill the given rectangle with the specified solid color.

void FillSolidRect( 
   LPCRECT lpRect, 
   COLORREF clr  
); 
void FillSolidRect( 
   int x, 
   int y, 
   int cx, 
   int cy, 
   COLORREF clr  
);
lpRect

Specifies the bounding rectangle (in logical units). You can pass either a pointer to a RECT data structure or a CRect object for this parameter.

clr   Specifies the color to be used to fill the rectangle.

x

Specifies the logical x-coordinate of the upper-left corner of the rectangle.

y

Specifies the logical y-coordinate of the upper-left corner of the destination rectangle.

cx

Specifies the width of the rectangle.

cy

Specifies the height of the rectangle.

FillSolidRect is very similar to CDC::FillRect; however, FillSolidRect uses only solid colors (indicated by the COLORREF parameter), while FillRect takes a brush and therefore can be used to fill a rectangle with a solid color, a dithered color, hatched brushes, or a pattern. FillSolidRect usually is faster than FillRect.

Note Note

When you call FillSolidRect, the background color, which was previously set using SetBkColor, is set to the color indicated by clr.

Header: afxwin.h

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.