首页  编辑  

如何实现ImageList中的所有Images输出到同一个bmp文件中

Tags: /超级猛料/Picture.图形图像编程/控件和绘图/   Date Created:

]、。·ˉˇ¨〃々—~‖…’”〕〉》」』〗】∶!"'),.:;?]` procedure SaveImageListToBmp(AImageList: TImageList; ABitmap: TBitmap);

const

 Spacing = 5;

var

 i: integer;

 FBitmap: TBitmap;

begin

 FBitmap := TBitmap.Create;

 try

   ABitmap.Width := AImageList.Count * (AImageList.Width + Spacing);

   ABitmap.Height := AImageList.Height;

   for i := 0 to AImageList.Count - 1 do

   begin

     AImageList.GetBitmap(i, FBitmap);

     ABitmap.Canvas.Draw(i * (AImageList.Width + Spacing), 0, FBitmap);

   end;

 finally

   FBitmap.Free;

 end;

end;