来自:卷起千堆雪tyn, 时间:2001-12-24 22:10:00, ID:809383<br><br>YB老弟说我没有诚意,唉,那我就来点诚意,无私一把,给大家一点小小技巧----关于蚂蚁线<br><br>>以下程序在一个表单上放置一个Timer控件,设置Interval :=100;<br><br>>实现PhotoShop里的流动线效果.<br><br>>以下程序字节数<512,简练,高效;原来PhotoShop也不过如此~~<br><br>unit n;<br><br>interface<br><br>uses<br><br>Windows,Forms,Graphics,Classes,ExtCtrls;<br><br>type<br><br>TF=class(TForm)<br><br>m:TTimer;<br><br>procedure mTimer(Sender:TObject);<br><br>end;<br><br>var<br><br>F:TF;<br><br>a:Byte;<br><br>implementation<br><br>{$R *.DFM}<br><br>procedure c(X,Y:Integer;t:TCanvas);stdcall;<br><br>begin<br><br>a:=a shl 1;<br><br>if a =0 then a:=1;<br><br>if (a and 224)>0 then<br><br>t.Pixels[X,Y]:=clWhite<br><br>else<br><br>t.Pixels[X,Y]:=clBlack;<br><br>end;<br><br>procedure TF.mTimer(Sender:TObject);<br><br>begin<br><br>LineDDA(0,0,333,333,@c,LongInt(Canvas));<br><br>end;<br><br>end.<br><br>>运行之后,有没有看见象蚂蚁在爬呢?<br><br>最后祝所有的DFW象爬动的蚂蚁般幸福快乐