美文网首页
delphi绘图

delphi绘图

作者: 风语007 | 来源:发表于2016-10-24 21:41 被阅读0次
procedure TForm1.Button3Click(Sender: TObject);
var
  flag: integer;
  FixRect: TRect;
  no:string;
begin
  PaintBox1.Canvas.Brush.Color := clRed;
  PaintBox1.Canvas.FillRect(PaintBox1.ClientRect);
  PaintBox1.Canvas.Brush.Color := clBlue;

  FixRect := PaintBox1.ClientRect;
  FixRect.Left := FixRect.Left-5;
  FixRect.Top := FixRect.Top-5;
  FixRect.Right := FixRect.Right-10;
  FixRect.Bottom := FixRect.Bottom-10;
  PaintBox1.Canvas.FillRect(FixRect);
  PaintBox1.Canvas.Brush.Color := clYellow;
  no := 'HELLOWORLDHELLOWOR\nFJEOJEEJGOEGJOEGJOE';
//  Flag := DT_SINGLELINE or DT_RIGHT or DT_CENTER;
  flag := DT_VCENTER;
  DrawText(PaintBox1.Canvas.Handle, PChar(No), Length(No), FixRect, Flag);
end;

相关文章

网友评论

      本文标题:delphi绘图

      本文链接:https://www.haomeiwen.com/subject/tuoluttx.html