codice:
oWin: Array[0..20] of TRectangle;
aWin: Array[3..20, 1..4] of integer = ((115,55,106,30), (70,75,221,30),
(115,55,291,30), (115,40,106,85),
(115,40,291,85), (115,55,106,125),
(70,75,221,105), (115,55,291,125),
(60,150,26,30), (60,150,420,30),
(207,60,305,186),(60,20,26,80),
(60,20,420,80), (205,60,0,186),
(93,66,209,189), (100,20,10,0),
(100,20,400,0), (100,20,206,0));
....
// creo le finestre rFondo è il Trectangle contenitore creato visualmente
for x := 3 to 20 do
begin
oWin[x] := TRectangle.Create(rFondo);
oWin[x].Parent := rFondo;
oWin[x].Width := aWin[x][1];
oWin[x].Height := aWin[x][2];
oWin[x].Position.X := aWin[x][3];
oWin[x].Position.Y := aWin[x][4];
oWin[x].Name := 'WIN_' + x.ToString;
oWin[x].Fill.Color := TAlphaColorRec.Black;
oWin[x].Fill.Kind := TBrushKind.Bitmap;
oWin[x].Fill.Bitmap.Bitmap.Create(aWin[x][1], aWin[x][2]); // creo bitmap interna
if x > 10 then
oWin[x].Stroke.Color := TAlphaColorRec.Darkred
else
oWin[x].Stroke.Color := TAlphaColorRec.White;
end;
Poi in chiusura libero gli oggetti creati