您的位置:首页 > 其它

压缩图像文件并转换成BMP格式

2004-01-25 21:18 169 查看
function GraphicToBmp(P: TPicture; Quality: Integer = 80): TBitmap;
var
Jpg: TJpegImage;
begin
Result := TBitmap.Create;
with Result do
begin
Width := P.Width;
Height := P.Height;
Canvas.Draw(0, 0, P.Graphic);
end;
if Assigned(Result) then
begin
Jpg := TJpegImage.Create;
Jpg.Assign(Result);
Jpg.CompressionQuality := Quality;
Jpg.JPEGNeeded;
Jpg.Compress;
if Assigned(Jpg) then
begin
Jpg.DIBNeeded;
Result.Assign(Jpg);
end;
end;
end;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: