Blob Blame Raw
unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs;

type

  { TForm1 }

  TForm1 = class(TForm)
    procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form1: TForm1;
  px: integer = 0;
  py: integer = 0;

implementation

{$R *.lfm}

procedure Line(x1, y1, x2, y2: integer);
var
  col, row: integer;
begin
  for col := -10 to 10 do begin
    for row := -10 to 10 do begin
      Form1.Canvas.MoveTo(x1 + col*200, y1 + row*200);
      Form1.Canvas.LineTo(x2 + col*200, y2 + row*200);
    end;
  end;
end;

procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  if ssRight in Shift then Form1.Refresh;
  if ssLeft in Shift then Line(px, py, x, y);
  px := x;
  py := y;
end;

end.