將image組件的圖片保存為JPG格式圖片方法
var
  jp: TJPEGImage;  //Requires the "jpeg" unit added to "uses" clause.
begin
  jp := TJPEGImage.Create;
  try
    with jp do
    begin
      jp.CompressionQuality := 2;
      jp.Compress ;   
      Assign(Image1.Picture.Bitmap);
      SaveToFile('D:/zhy.jpg');
    end;
  finally
    jp.Free;
  end;
  ////---讀入方法如下:
procedure OpenJPGInImage
var
  jp: TJPEGImage;  //Requires the "jpeg" unit added to "uses" clause.
begin
  jp := TJPEGImage.Create;
  jp.LoadFromFile('D:/zhy.jpg');
  try
    with jp do
    begin
      image1.Picture.Bitmap.Assign(jp);
    end;
  finally
    jp.Free;
  end;
end;