[求助]windows编程时,怎样为不规则图形填充颜色?
小弟用如下代码,打算为一个闭合的无规则图形填充颜色,但行不通,请高手指点。
hdc = BeginPaint( hwnd, &ps );
SetMapMode( hdc, MM_TEXT );
hP = CreatePen( PS_INSIDEFRAME, 1, BLACK_PEN );
hB = CreateHatchBrush( HS_VERTICAL, RGB( 255, 0, 255 ) );
SelectObject( hdc, hB );
SelectObject( hdc, hP );
MoveToEx( hdc, 380, 460, NULL );
LineTo( hdc, 450, 380 );
LineTo( hdc, 400, 300 );
LineTo( hdc, 280, 360 );
LineTo( hdc, 380, 460 );
EndPaint( hwnd, &ps );
DeleteObject( hP );
DeleteObject( hB );
小弟刚开始学windows 编程,所以请高手详细说吸,谢谢