Project Res.exe raised exception class EJPEG with message 'JPEG error #42'. Process stopped. Use Step or Run to continue.

解决方案 »

  1.   

    http://www.csdn.net/expert/topic/570/570255.xml?temp=.5542871
      

  2.   

    Myjpg.LoadFromStream(Source);
        JpgImg.Picture.Bitmap.Assign(Myjpg);
    就是第二句出现了那个异常
      

  3.   

    语句好像没问题呀
    loadfromfile()怎样?
      

  4.   

    就是不能用loadfromfile()啊,内容是从“流“中读出来的哦!
      

  5.   

    我遇到过这样的错误,当时是JPEG文件损坏了。你试试把从流中读出来的数据存为文件,看看是否是正常的JPEG文件。
      

  6.   

    看看你的stream.position是不是0!!!!
      

  7.   

    请教keyz,你说的JPEG文件损坏是指读到流之后损坏还是本身JPEG文件损坏了?
      

  8.   

    这个问题我刚刚解决
    1。Myjpg.LoadFromStream(Source);
    2。JpgImg.Picture.Bitmap.Assign(Myjpg);
    2句的bitmap和你要存储的jpeg根本就不是同一个类。
    解决的办法是:
    uses .......jpeg;
    ...
    ...
    ...
    {$*.res}var
      jp:TjpegImage;
      bi:Tbitmap;
    procedure .....
      jp:=TjpegImage.create;
      bi:=Tbitmap.create;
      jp:=nil;
      bi:=nil;
      读入jpeg文件,并保存到数据库
      if opendialog1.execute then 
      begin
        if image1.picture.graphic is Tjpegimage then 
        begin
          jp.assign(image.picture);
          jp.savetofile('c:\temp.jpg');
          下面是你的数据库语句了
        end; 
        if image1.picture.graphic is Tbitmap then 
        begin
          bi.assign(image.picture);
          bi.savetofile('c:\temp.bmp');
          下面是你的数据库语句了
        end 
        从数据库中去出数据,并显示在image主件中(略) 
        好运大家!!!
        注意:提醒大家一下去出数据,并显示在image中时也需要一些技巧的,自己想想!!!
      end;