我看了一段程序,如下:
procedure c(X,Y:Integer;t:TCanvas);stdcall;
begin
  a:=a shl 1;
  if a =0 then a:=1;
  if (a and 224)>0 then
    t.Pixels[X,Y]:=clWhite
  else
    t.Pixels[X,Y]:=clred;
end;procedure TForm1.Timer1Timer(Sender: TObject);
begin
  LineDDA(0,150,380,150,@c,LongInt(Canvas));
end;我试过,效果还不错,可是哪位有办法能将线加粗吗?
我开始以为是用TCanvas的画笔画的,我就t.pen.Width:=3;
可是事实上不是!

解决方案 »

  1.   

    用的是像素吧,根据趋势多写几个pixels应该可以
      

  2.   

    if (a and 224)>0 then
        begin
        t.Pixels[X,Y]:=clWhite
        t.Pixels[X,Y-1]:=clWhite
        t.Pixels[X,Y+1]:=clWhite
        end
      else
        begin
        t.Pixels[X,Y]:=clred;
        t.Pixels[X,Y-1]:=clred;
        t.Pixels[X,Y+1]:=clred;
        end;
      

  3.   

    谢谢楼上的回答,问题解决了!
    可是我想问一下,为什么我右边的坐标最多只能达到380,而不能超过它呢!
    一超过它就看不到线的流动呢!
    意思就是说如果我这样调用的话:
    LineDDA(0,150,400,150,@c,LongInt(Canvas));
    它就不流动了!