我的程序是这样的的
procedure TForm1.Open1Click(Sender: TObject);
begin
  // 打开OpenDialog对话框,打开图形文件加载画布上(Image1)
  if OpenDialog1.Execute then
  begin
    CurrentFile := OpenDialog1.FileName;
    Image.Picture.LoadFromFile(CurrentFile);
    image.Canvas.
  end;
end;
//在图片上写入文字
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
   image.Canvas.Font.Style:= [fsBold];
   image.Canvas.Font.Size:=15;
   image.Canvas.TextOut(strtoint(edit2.Text),strtoint(edit3.Text),edit4.Text);
end;
然后我想保存并转换成jpg的图像,应该怎么做呢

解决方案 »

  1.   

    uses
      Jpeg;procedure .......;
    var
      jpg: TJpegImage;
    begin
      jpg := TJpegImage.Create;
      jpg.Width := image.Picture.Width;
      jpg.Height := image.Picture.Height;
      jpg.Assign(image.Picture.Bitmap);
      jpg.SaveToFile('c:\temp.jpg');
      jpg.Free;
    end;如果你打开的是元文件或图标,则不行。
    Use Bitmap to reference the picture object when it contains a bitmap. If Bitmap is referenced when the picture contains a Metafile or Icon graphic, the graphic won't be converted. Instead, the original contents of the picture are discarded and Bitmap returns a new, blank bitmap. 
      

  2.   

    BMP与JPG互转,代码如下:
    uses
      Graphics,
      Jpeg;procedure BMP2JPG(const BMPFile: string);
    var
      BMP: TBitmap;
      JPG: TJpegImage;
      FileName: string;
    begin
      FileName := BMPFile;  BMP := TBitmap.Create;
      JPG := TJpegImage.Create;  try
        BMP.LoadFromFile(FileName);
        JPG.Assign(BMP);
        FileName := ChangeFileExt(FileName, '.jpg');
        JPG.SaveToFile(FileName);
      finally
        BMP.Free;
        JPG.Free;
      end;
    end;procedure JPG2BMP(const JPGFile: string);
    var
      BMP: TBitmap;
      JPG: TJpegImage;
      FileName: string;
    begin
      FileName := JPGFile;  BMP := TBitmap.Create;
      JPG := TJpegImage.Create;  try
        JPG.LoadFromFile(FileName);
        BMP.Assign(JPG);
        FileName := ChangeFileExt(FileName, '.bmp');
        BMP.SaveToFile(FileName);
      finally
        BMP.Free;
        JPG.Free;
      end;
    end;
      

  3.   

    百度搜一下就有了!
    "DELPHI bmp转jpg"就有了!!