procedure TForm1.Button8Click(Sender: TObject);
var
image:tgpimage;
guid:tguid;
  I,J : Integer;
  begin
  J:=0;
     for k:=0 to Listbox1.Items.Count - 1 do
     begin
          ListBox1.ItemIndex := k;
          form1.Refresh;
      if  k <> -1 then
      begin
          image:=tgpbitmap.create(ListBox1.Items.Strings[k]);
          image.getframedimensionslist(@guid, 1);//得到多帧tif文件的页数
          i:=image.getframecount(guid);      end;
      ListBox1.Items.Strings[k]:= ListBox1.Items.Strings[k]+'----------'+inttostr(i)+'页' ;
       J:=I+J;
      end;
      y:=j;
      edit1.text:='共搜索到TIF文件'+inttostr(listbox1.Items.Count)+'个!---统计页数总计:'+inttostr(j)+'页!';
      messageBox(0,PChar('统计完成!总计页数'+inttostr(j)+'页!'),PChar('计算完成'),0);
   end;
超过2000+条后,i值都为0,还出现EOUTOFRESOURCES “UNABLE TO INSERT A LINE”,求大虾帮助!谢谢

解决方案 »

  1.   

    情况是这样的,LISTboX里面的条数小于一个数量的时候不会报错,计算运行正常,超过那个条数,I值都是0,还有UNABLE
      

  2.   

    if  k <> -1 then
          begin
              image:=tgpbitmap.create(ListBox1.Items.Strings[k]);
              image.getframedimensionslist(@guid, 1);//得到多帧tif文件的页数
              i:=image.getframecount(guid);
             // LABEL2.Caption:=INTTOSTR(I);
             // if i=0 then
              //edit1.text:= ListBox1.Items.Strings[k];
          end;
         // ListBox1.Items.Strings[k]:= ListBox1.Items.Strings[k]+'----------'+ListBox1.Items.Strings[k]+'页' ;
           J:=I+J;
           Y:=Y+1;
               if i=0 then      BEGIN
         LABEL2.Caption:=INTTOSTR(Y);
          edit1.text:='共搜索到TIF文件'+inttostr(listbox1.Items.Count)+'个!---统计页数总计:'+inttostr(j)+'页!';
          messageBox(0,PChar('统计完成!总计页数'+inttostr(j)+'页!'),PChar('计算完成'),0);
       END;
       END;
       end;添加判断后测试1523条后,I值都为0
      

  3.   

    i:=image.getframecount(guid);
    i是从这来的,继续跟啊
      

  4.   

    问题解决了,IMAGE.FREE;
    跟踪了一下内存,坑爹啊!谢谢bdmh