卷
卷起千堆雪tyn
Unregistered / Unconfirmed
GUEST, unregistred user!
Timer1.Interval = 200;
var
Form1: TForm1;
Counter :Byte;
implementation
{$R *.DFM}
procedure MovingDots(X,Y: Integer; TheCanvas: TCanvas); stdcall;
begin
Counter := Counter shl 1; // Shift the bit left one
if Counter = 0 then Counter := 1; // If it shifts off left, reset it
if (Counter and 224) > 0 then // Are any of the left 3 bits set?
TheCanvas.Pixels[X,Y] :=clBtnFace // Erase the pixel
else
TheCanvas.Pixels[X,Y] :=clBlack; // Draw the pixel
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
LineDDA(30,30,200,30,@MovingDots,LongInt(Canvas));
LineDDA(200,30,200,150,@MovingDots,LongInt(Canvas));
LineDDA(200,150,30,150,@MovingDots,LongInt(Canvas));
LineDDA(30,150,30,30,@MovingDots,LongInt(Canvas));
end;