Pixels (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This example draws a red line (very slowly) when you press a button. Attach the following code to the button's OnClick event handler.

Code

procedure TForm1.Button1Click(Sender: TObject);
var
  W: Word;
begin
    for W := 10 to 200 do
      Canvas.Pixels[W, 10] := clRed;
end;

Uses