如何提高imageEn的浏览速度? (50分)

  • 主题发起人 主题发起人 cansim
  • 开始时间 开始时间
C

cansim

Unregistered / Unconfirmed
GUEST, unregistred user!
用IMAGEEN来浏览图片,当图片多一点,或大一点的时候速度极慢,有什么办法弄快一点?P41。8G、256DDR了速度还是不能忍受!
 
就是要象ACDSEE那样显示缩略图片,以前用image来做,图片多几张占用内存大得惊人
行不通。有什么好办法请大家给点提示!谢谢
 
当然可以,用ListView就行。ACDSee用的就是ListView,例子我以前帖过。
 
to :zw84611
能不能再贴出来看看,谢谢!
 
应该是这个吧?在离线包里找到的!


我觉得你只能得到最后一幅的缩略图,因为每次image2.Canvas.StretchDraw,image2都整个
重画了一遍。
用TImage不是一个好主意,不妨用ListView和ImageList好些。
下面这段是我以前的一个程序中拷下来的,要做一些改动,但大概意思是这样。

procedure TListVThread.Execute;
var i,tw,th:integer; bitmap,map:tbitmap;arect,brect:trect;
begin
with mybook do
begin
listview1.show;
gauge1.Show;
//label4.caption:='共'+inttostr(it);
if not brdone then
begin
filelistbox1.mask:='*.bmp;*.jpg;*.jpeg;*.emf;*.wmf;*.psd;*.pdd;*.tif; *.tiff;*.fax;*.bw;*.rgb;*.rgba;*.sgi;*.cel; *.pic;*.tga; *.vst;*.icb; *.vda; *.win;*.pcx;*.pcc;*.scr;*.pcd;*.ppm;*.pgm;*.pbm;*.cut;*.pal;*.rla;*.rpf;*.rle;*.dib;*.psp;*.png';
filelistbox1.Update;
it:=filelistbox1.Items.Count;
gauge1.MaxValue := it;
listview1.Items.Clear;
imagelist1.Clear;
w:=imagelist1.Width;
h:=imagelist1.height;
arect.Left :=0;
arect.Top :=0;
arect.Right :=w;
arect.Bottom :=h;
brect:=arect;
map := TBitmap.Create;
for i:=1 to it do
begin
s:=filelistbox1.Items[i-1];
image1.picture.LoadFromFile(s);
tw:=image1.Picture.Width;
th:=image1.Picture.height;
Bitmap := TBitmap.Create;
Clipboard.Assign(Image1.Picture);
map.LoadFromClipBoardFormat(cf_BitMap,ClipBoard.GetAsHandle(cf_Bitmap),0);
bitmap.Width :=w;
bitmap.height:=h;
bitmap.Canvas.Rectangle(brect);
if(tw<w)and(th<h) then
bitmap.canvas.Draw(w div 2-tw div 2,h div 2-th div 2,map)
else
begin
if tw>th then
begin
arect.left:=0;
arect.Right:=w;
tem:=round(w*(th/tw));
arect.top:=(h-tem) div 2;
arect.bottom:=arect.top+tem;
end
else
begin
arect.top:=0;
tem:=round(h*(tw/th));
arect.Left :=w div 2- tem div 2;
arect.Right:=arect.left+tem;
arect.bottom:=h;
end;
bitmap.Canvas.StretchDraw(arect,map)
end;
imagelist1.Add(bitmap,bitmap);
listview1.Items.Add;
pi:=i;
synchronize(prog);
//caption:='Isee '+inttostr(round(i/it*100))+'%';
listview1.Items[i-1].imageindex:=i-1;
listview1.Items[i-1].Caption:=s;
end;
caption:='Isee';
//listview1.Cursor:=crdefault;
gauge1.Hide;
gauge1.Progress := 0;
SpeedButton42.Enabled := false;
SpeedButton43.Enabled := false;
SpeedButton26.Enabled := true;
brdone:=true;
statusbar1.panels.items[1].text:='共打开'+inttostr(it)+'个文件 ';
end;
end;
end;
 
我照搬了,但LISTVIEW里面不显示图片啊!什么都没有?
什么语句负责在LISTVIEW里面显示图片啊??
刚学DELPHI什么都不会。
 
注意你要将ListView的LargeImages属性设为ImageList1,并ImageList1的Masked属性设为false。
 
我用image来做,450个图片内存资源使用为18,000k左右
但速度很慢.50个图片还可以忍受!!哈哈
 
我用IMAGE的话50张就占用了13M左右了啊
终于用 IMAGEEN实现了
现在想在一张A4纸里面均匀打印8张图片,有什么办法啊???
 
我实现了,用数据库保存,用listview和imagelist,
读出来200张需4秒,P650机。如要,给我E-mail.
 
to:liuind
我的MAIL是cansim@tom.com麻烦你发一份给我,参考参考!
十分感谢!
 
怎么个浏览法?是一张顺序地看?还是看Thmubnail?文件是什么格式?像素是多大单边有5000点吗?色彩位是多少?
 
我也要
kevin_4587@163.com
 
guamusoft@msn.com谢谢
 
请给我发一下,web@he365.com谢谢!
 
请也给我发一份吧!我也在学一个图像管理软件!谢谢!(peirongvsmimi@yahoo.com.cn)
 
acme_genl@hotmail.com
....
 
后退
顶部