//声明: CreateHatchBrush( p1: Integer; {阴影样式} p2: COLORREF {颜色值} ): HBRUSH; {返回画刷句柄} //p1 参数可选值: HS_HORIZONTAL = 0; HS_VERTICAL = 1; HS_FDIAGONAL = 2; HS_BDIAGONAL = 3; HS_CROSS = 4; HS_DIAGCROSS = 5; //举例: procedure TForm1.FormPaint(Sender: TObject); var BrushStyle: Integer; BrushHandle: HBRUSH; begin BrushStyle := RadioGroup1.ItemIndex; BrushHandle := CreateHatchBrush(BrushStyle, clRed); FillRect(Canvas.Handle, Rect(16,16,100,120), BrushHandle); DeleteObject(BrushHandle); end; procedure TForm1.RadioGroup1Click(Sender: TObject); begin Refresh; end; //效果图:
WinAPI: CreateHatchBrush - 建立阴影画刷
最新推荐文章于 2020-12-19 21:02:12 发布