const imgdir = 'D:/Work/票据影像/';procedure TForm1.FormCreate(Sender: TObject);begin imgBitmap := TBitmap.Create; imgsrc := TJPEGImage.Create; jpg := TJPEGImage.Create;end;procedure TForm1.FormDestroy(Sender: TObject);begin imgBitmap.Free; imgsrc.Free; jpg.Free;end;procedure TForm1.Button1Click(Sender: TObject);var sFile: TSearchRec; filestream: tmemorystream;begin if FindFirst(imgdir+'*.jpg',faAnyFile,sFile) = 0 then repeat if (Trim(sFile.Name)='.') or (Trim(sFile.Name)='..') then Continue; if (sFile.Attr and faAnyFile) = sFile.Attr then begin try filestream:= tmemorystream.Create; filestream.LoadFromFile(imgdir+sfile.Name); filestream.SaveToFile('./img/F.jpg'); jpg.LoadFromStream(filestream); jpg.SaveToFile('./img/F_0.jpg'); //******以下方法是错误的***********// imgsrc.Assign(jpg); imgsrc.SaveToFile('./img/F_1.jpg'); imgBitmap.Assign(nil); imgBitmap.Assign(imgsrc); imgBitmap.SaveToFile('./img/F_2.jpg'); //*********************// Sleep(3000); finally filestream.Destroy; end; end; until FindNext(sFile) <> 0 ; FindClose(sFile);正确方式: //******以下方法是正确的***********// imgsrc:=jpg; imgsrc.SaveToFile('./img/F_1.jpg'); imgBitmap.Assign(nil); imgBitmap.Assign(imgsrc); imgBitmap.SaveToFile('./img/F_2.jpg'); //*********************//测试通过...