What else are you doing? I put your code into the OnCreate method of a form, added time measuring steps and found that the 1000 images are created within 0.008 sec. Even with assigning the appliation icon to each image it only takes 0.1 sec. That not "very, very, slow".
procedure TForm1.FormCreate(Sender: TObject);
var
ic, iic: Integer;
t: TDateTime;
begin
t := Now();
for iC := 1 to 50 do
for iiC := 1 to 20 do
begin
pix[iC, iiC] := TImage.Create(Self);
pix[iC, iiC].Parent := Panel1;
pix[iC, iiC].Width := 15;
pix[iC, iiC].Height := 15;
pix[iC, iiC].Left := (iiC - 1) * 15;
pix[iC, iiC].Top := (iC - 1) * 15;
pix[iC, iiC].Visible := True;
pix[iC, iiC].Enabled := True;
pix[iC, iiC].Picture.Assign(Application.Icon);
end;
t := Now() - t;
Caption := FormatDateTime('s.zzz"s"', t);
end;
On the other hand, when this code is run in the OnClick event handler of a button, when the form is already show, it becomes much slower: 8 seconds. The reason is - probably - that the panel is repainted after adding each new image. An easy (and cross-platform) way to prevent this is to hide the panel before, and to re-show it after inserting the images. (there are certainly more sophisticated and better solutions..., but i did not want to spend too much thinking...)