Bmp:=TBitmap.Create;
Bmp.Width:=NWidth; //You should set it to your expected value;
Bmp.Height:=NHeight; //You should set it to your expected value;
Bmp.Canvas.CopyRect(Rect(0,0,Bmp.Width-1,Bmp.Height-1),CurImage.Canvas,Rect(OldX,OldY,X,Y));
jpg:=TJpegImage.Create;
try
with jpg do begin Assign(Bmp); SaveToFile(FileName) end;
finally
jpg.Free; Bmp.Free
end;
另外:
不用象你那样去画线;用CurImage.Canvas.Rectagle画矩形更好;画的时候,MouseDown、
MouseMove响应时都用异或方式画,以便擦除。