procedure TForm1.Button1Click(Sender: TObject);
var
Temp, Bmp: TBitmap;
i: Integer;
begin
if SavePictureDialog1.Execute then begin
Bmp := TBitmap.Create;
Temp := TBitmap.Create;
try
with Bmp do begin
Width := ImageList1.Width * ImageList1.Count;
Height := ImageList1.Height;
PixelFormat := pf24Bit;
end;
with Temp do begin
Width := ImageList1.Width;
Height := ImageList1.Height;
PixelFormat := pf24Bit;
with Canvas.Brush do begin
Color := clWhite;
Style := bsSolid;
end;
end;
for i := 0 to ImageList1.Count - 1 do begin
Temp.Canvas.FillRect(Rect(0, 0, Temp.Width, Temp.Height));
ImageList1.GetBitmap(i, Temp);
Bmp.Canvas.Draw(i * ImageList1.Width, 0, Temp);
end;
Bmp.SaveToFile(SavePictureDialog1.FileName);
finally
Bmp.Free;
Temp.Free;
end;
end;
end;