【发布时间】:2015-08-04 08:39:42
【问题描述】:
我的 TImage 组件中存储了一些数据。我想将图像保存为位图。执行此代码,TImage 内容变为白色,并且在硬盘上仅创建了一个 0 字节的 bmp 文件。我的代码有什么问题?
MainStatusbar.SimpleText := 'save the image .... ';
if SaveDialog.Execute then
begin
Image1.picture.Bitmap.SaveToFile(SaveDialog.filename);
end;
MainStatusbar.SimpleText := 'done ';
【问题讨论】:
-
您的图像要么是空的,要么它的图片不是位图。请改用
Image1.Picture.SaveToFile(SaveDialog.FileName)。