del
本例效果图:


unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  TForm1 = class(TForm)
    procedure FormPaint(Sender: TObject);
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

uses GDIPOBJ, GDIPAPI;

procedure TForm1.FormPaint(Sender: TObject);
var
  g: TGPGraphics;
  p: TGPPen;
begin
  g := TGPGraphics.Create(Canvas.Handle);
  p := TGPPen.Create(MakeColor(255,0,0), 2);
  g.Clear(MakeColor(255,255,255));

  g.DrawLine(p, 20, 40, 200, 40);                                 {参数是整数}
  g.DrawLine(p, MakePoint(20,60), MakePoint(200,60));             {参数是点(整数)}
  g.DrawLine(p, 20.9, 80.0, 200.9, 80.0);                         {参数是小数}
  g.DrawLine(p, MakePoint(20.9, 100.0), MakePoint(200.9, 100.0)); {参数是点(小数)}

  g.Free;
  p.Free;
end;

end.

分类:

技术点:

相关文章:

  • 2021-07-15
  • 2021-12-19
  • 2021-11-07
  • 2021-09-10
  • 2021-11-17
  • 2021-08-15
  • 2021-08-03
  • 2021-05-04
猜你喜欢
  • 2021-08-09
  • 2021-08-16
  • 2021-06-15
  • 2021-12-22
  • 2021-07-30
  • 2021-12-29
相关资源
相似解决方案