CDC::FillRect This method fills a specified rectangle using the specified brush. The method fills the complete rectangle, including the left and top borders, but it does not fill the right and bottom borders.void FillRect( LPCRECT lpRect, CBrush* pBrush ); Parameters lpRect Pointer to a RECT structure that contains the logical coordinates of the rectangle to fill. You can also pass a CRect object for this parameter. pBrush Identifies the brush used to fill the rectangle. Res The brush must be created using the CBrush methods CreatePatternBrush, and CreateSolidBrush, or retrieved by the GetStockObject Windows CE function. When filling the specified rectangle, FillRect does not include the right and bottom sides of the rectangle. The GDI fills a rectangle up to, but does not include, the right column and bottom row, regardless of the mapping mode. FillRect compares the values of the top, bottom, left, and right members of the specified rectangle. If bottom is less than or equal to top, or if right is less than or equal to left, the rectangle is not drawn.FillRect is similar to CDC::FillSolidRect; however, 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 uses only solid colors, indicated by a COLORREF parameter. FillRect usually is slower than FillSolidRect. Requirements Windows CE versions: 1.0 and later Header file: Declared in Afxwin.h Platform: H/PC Pro, Palm-size PC, Pocket PC
试试
This method fills a specified rectangle using the specified brush. The method fills the complete rectangle, including the left and top borders, but it does not fill the right and bottom borders.void FillRect(
LPCRECT lpRect,
CBrush* pBrush );
Parameters
lpRect
Pointer to a RECT structure that contains the logical coordinates of the rectangle to fill. You can also pass a CRect object for this parameter.
pBrush
Identifies the brush used to fill the rectangle.
Res
The brush must be created using the CBrush methods CreatePatternBrush, and CreateSolidBrush, or retrieved by the GetStockObject Windows CE function. When filling the specified rectangle, FillRect does not include the right and bottom sides of the rectangle. The GDI fills a rectangle up to, but does not include, the right column and bottom row, regardless of the mapping mode. FillRect compares the values of the top, bottom, left, and right members of the specified rectangle. If bottom is less than or equal to top, or if right is less than or equal to left, the rectangle is not drawn.FillRect is similar to CDC::FillSolidRect; however, 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 uses only solid colors, indicated by a COLORREF parameter. FillRect usually is slower than FillSolidRect. Requirements
Windows CE versions: 1.0 and later
Header file: Declared in Afxwin.h
Platform: H/PC Pro, Palm-size PC, Pocket PC
CRect rect(0,0,100,100);
***->FillRect(rect,&m_Brush);
#include <afxwin.h>
...
LRESULT CALLBACK WndProc( HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam )
{
RECT rect;
rect.top = 100;
rect.left = 100;
rect.right = 150;
rect.bottom = 150;
switch( message ) {
case WM_CREATE:
FillSolidRect( rect, RGB( 255, 0, 0 ) ); <--
break;
case WM_DESTROY:
PostQuitMessage( 0 );
break;
} return DefWindowProc( hwnd, message, wParam, lParam );
}'FillSolidRect' : undeclared identifier高手帮忙