delphi JPG/JPEG 图片缩放函数


function ChangeJpegSize(FileName,FileName2: string; W, H: Integer): Boolean;
var
jpg: TJPEGImage;
bmp: TBitmap;
begin
Result := False;
jpg := TJPEGImage.Create;
try
    jpg.LoadFromFile(FileName);
    bmp := TBitmap.Create;
    bmp.Width := W;
    bmp.Height := H;
    bmp.Canvas.StretchDraw(Rect(0, 0, bmp.Width, bmp.Height), jpg);
    jpg.Assign(bmp);
    try
      jpg.SaveToFile(FileName2);
      Result := True;
    finally
      bmp.Free;
    end;
finally
    jpg.Free;
end;
end;

联系电话:
020-00000000
联系电话:
020-00000000
联系电话:
020-12345678