Registriert seit: 20. Jun 2003
282 Beiträge
Delphi 10.4 Sydney
|
Re: color integer wert von "grau"
24. Nov 2004, 10:38
Ich habe dein Code mal etwas umgeschrieben, so sollte er gehen:
Delphi-Quellcode:
var
Form1: TForm1;
MyPoints: array [0..255] of TPoint;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
for i:=Low(MyPoints) to High(MyPoints)-1 do
MyPoints[i]:=Point(-1, -1);
end;
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var i : Integer;
begin
Canvas.Brush.Color:=clBlack;
Canvas.FillRect(Rect(0, 0, Width, Height));
for i:=Low(MyPoints) to High(MyPoints)-1 do
MyPoints[i]:=MyPoints[i+1];
MyPoints[High(MyPoints)]:=Point(X, Y);
for i:=Low(MyPoints) to High(MyPoints) do
If (MyPoints[i].X<>-1) and (MyPoints[i].Y<>-1) then
Canvas.Pixels[MyPoints[i].X, MyPoints[i].Y]:= RGB(i, i, i);
end;
|
|
Zitat
|