[delphi][GDI+] 学习记录(7): 实心画刷 – SolidBrush

  • A+
所属分类:[开发技巧]

//实心画刷
var
g: TGPGraphics;
sb: TGPSolidBrush;
begin
g := TGPGraphics.Create(Canvas.Handle);
sb := TGPSolidBrush.Create(aclGreen); {参数是颜色}
g.FillEllipse(sb, 11, 11, 222, 111);
sb.Free;
g.Free;
end;


//设置画刷颜色
var
g: TGPGraphics;
sb: TGPSolidBrush;
begin
g := TGPGraphics.Create(Canvas.Handle);
sb := TGPSolidBrush.Create(MakeColor(255,0,0));
g.FillRectangle(sb,10,10,100,100);
sb.SetColor(MakeColor(255,0,255)); {设置画刷颜色}
g.FillEllipse(sb,111,10,222,88);
sb.Free;
g.Free;
end;

  • 我的微信
  • 这是我的微信扫一扫
  • weinxin
  • 我的微信公众号
  • 我的微信公众号扫一扫
  • weinxin
广告也精彩
avatar
广告也精彩

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: