因为要用Listview显示图片的缩略图,而ImageList只能用bmp格式的,所以需要将jpg文件先转换成bmp,然后再显示,jpg转换成bmp的函数如下,一张3M多的数码照片转换起来明显感觉到有些慢,如果照片多了速度就会非常慢,有没有好一点的办法可以提高速度?谢谢!
jpgFile := TJpgImage.Create;
bmpFile := TBitmap.Create;
try
jpgFile.LoadFromFile(JpgFileName);
bmpFile.Assign(jpgFile);
except end;
jpgFile := TJpgImage.Create;
bmpFile := TBitmap.Create;
try
jpgFile.LoadFromFile(JpgFileName);
bmpFile.Assign(jpgFile);
except end;
解决方案 »
- delphi 基本问题求解
- 如果在线程中出现异常会怎样?
- 没有注册类别
- 大家看看!急啊!!!
- 我想在combobox1选择显示:编号=姓名,然后插入数据库只插入其中的编号,如何实现
- 程序打包
- 递归调用的奇怪部题,请大哥们帮忙救急!
- 用QuickRep打印为什么打印纸张大小设为custom类型后可以预览但是不能打印?
- 急......在线等....不理解修改数据时系统提示的错误信息
- 请问如何得到网络邻居中看得到的计算机名列表
- 在Delphi中,如何用程序来分析SQL或Access数据表的结构,如:
- 在一个stringgrid控件上,当鼠标停留后,我如何知道鼠标停留在哪一个网格上,或者如何发送鼠标的单击消息。
MyJpeg: TJpegImage;
Image1: TImage;
begin
Image1:= TImage.Create(self);
MyJpeg:= TJpegImage.Create;
Image1.Picture.Bitmap.LoadFromFile('c:\windows\desktop\aa.BMP'); // Load the Bitmap from a file
MyJpeg.Assign(Image1.Picture.Bitmap); // Assign the BitMap to MyJpeg object
MyJpeg.CompressionQuality:=StrToInt('75');
MyJpeg.Compress;
MyJpeg.SaveToFile('c:\windows\desktop\test.JPG'); // Save the JPEG to Disk
end;var
MyJpeg: TJpegImage;
bmp: Tbitmap;
begin
bmp:=tbitmap.Create;
MyJpeg:= TJpegImage.Create;
myjpeg.LoadFromFile('c:\windows\desktop\aa.jpg');
bmp.Assign(myjpeg);
bmp.SaveToFile('c:\windows\desktop\test.bmp'); // Save the JPEG to Disk
end;