现在的位置: 首页 > 综合 > 正文

WinAPI: CreateHatchBrush – 建立阴影画刷

2011年08月15日 ⁄ 综合 ⁄ 共 501字 ⁄ 字号 评论关闭
//声明:
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;
//效果图:



抱歉!评论已关闭.