unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
Plaat: array[1..10] of TImage;
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
const
W = 200;
H = 100;
DIST = 10;
var
i: Integer;
x, y: Integer;
begin
x := DIST;
y := DIST;
for i := 1 to 10 do
begin
Plaat[i] := TImage.Create(self);
Plaat[i].Parent := Self;
Plaat[i].Color:= clWhite;
Plaat[i].Width:= W;
Plaat[i].Height:= H;
Plaat[i].Top:= y;
Plaat[i].Left:= x;
Plaat[i].Canvas.Pen.Width:= 3;
Plaat[i].Canvas.Font.Size:= 18;
Plaat[i].Canvas.Brush.Color := clWhite;
Plaat[i].Canvas.FillRect(0,0,Plaat[i].Width, Plaat[i].Height);
Plaat[i].Canvas.TextOut(10,10,'Te lezen?');
x := x + W + DIST;
if x > 2 *(W+DIST) then // two images per row
begin
y := y + H + DIST;
x := DIST;
end;
end;
Width := 3*DIST + 2*W;
Height := 6*DIST + 5*H;
end;
end.