今天图老师小编要跟大家分享LineDDA的一个例子,精心挑选的过程简单易学,喜欢的朋友一起来学习吧!
【 tulaoshi.com - 编程语言 】
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, Buttons;
type
TfmMain = class(TForm)
procedure FormPaint(Sender: TObject);
end;
var
fmMain: TfmMain;
A: Byte;
implementation
uses math;
{$R *.dfm}
procedure c(X,Y:Integer; ACanvas:TCanvas);stdcall;
begin
Inc(A,2);
ACanvas.Pen.Width := 5;
if Odd(A mod 31) then
ACanvas.Pen.Color := clWhite
else
ACanvas.Pen.Color := clBlack;
ACanvas.MoveTo(x,y);
ACanvas.LineTo(x,y);
end;
procedure TfmMain.FormPaint(Sender: TObject);
begin
LineDDA(0,20,width,20,@c,LongInt(Canvas));
LineDDA(0,0,width,Height,@c,LongInt(Canvas));
end;
end.
来源:http://www.tulaoshi.com/n/20160219/1611948.html
看过《LineDDA的一个例子》的人还看了以下文章 更多>>