图形文件转换
操作平台:WIN2K
数据库系统:SQL2K
问题:
怎样将JPG格式的图片转换成24位位图来保存?
问题点数:20、回复次数:2Top
1 楼Carfield(一只特别懒的猫)回复于 2002-03-05 14:51:55 得分 20
function Bmp2Jpg(Bmp: TBitmap; Quality: Integer = 100): TJpegImage;
begin
Result := nil;
if Assigned(Bmp)
then begin
Result := TJpegImage.Create;
Result.Assign(Bmp); {Its all folks...}
Result.CompressionQuality := Quality;
Result.JPEGNeeded; {Key method...}
Result.Compress;
end;
end;
function Jpg2Bmp(Jpg: TJpegImage): TBitmap;
begin
Result := nil;
if Assigned(Jpg)
then begin
Result := TBitmap.Create;
Jpg.DIBNeeded; {Key method...}
Result.Assign(Jpg); {Its all folks...}
end;
end;
Top
2 楼quark(夸克)回复于 2002-03-05 15:53:43 得分 0
//==============================================================================
//转换JPG到BMP格式**************************************************************
//==============================================================================
procedure JPG2BMP(const Source, Target:string);
var JPG: TJpegImage;
BMP: TBitmap;
begin
BMP := TBitmap.Create;
JPG := TJpegImage.Create;
try
JPG.LoadFromFile(Source);
BMP.Assign(JPG);
BMP.SaveToFile(Target);
finally
BMP.free;
JPG.Free;
end;
end;
//==============================================================================
//转换BMP到JPG格式**************************************************************
//==============================================================================
procedure BMP2JPG(const Source, Target:string; const Scale: Byte);
var Image: TImage;
JPG: TJpegImage;
begin
Image := TImage.Create(Application);
JPG := TJpegImage.Create;
try
Image.Picture.Bitmap.LoadFromFile(Source);
JPG.Assign(Image.Picture.Bitmap);
JPG.CompressionQuality := Scale;
JPG.Compress;
JPG.SaveToFile(Target);
finally
Image.free;
JPG.Free;
end;
end;
Top
相关问题
- 请问如何将BMP图形文件转换为JPEG文件
- !!!请问3d max 制作出的图形文件能否转换!!!
- html转换成chm文件,图形显示不出来
- 求转换gif图形文件到png文件的java程序/算法!
- 关注:怎样才能将JPG(JPEG)格式的图形文件转换成BMP格式的图形文件呢???
- 30分加上饭局(北京),聊一聊怎样把TTF字体文件转换成图形文件(gif等)
- 如何将位图文件中的图形提取出,并转换成DXF文件?给出思路即可。
- 如何把word和txt,还有一些图形文件转换成传真文件(tif,tiff)的格式
- 图形高手:请问如何将Bmp或Jpeg文件转换成3dHome的格式文件,有大批量的图需要转换?
- 请问什么软件可以将gif,bmp的小图形转换成.ico文件,以方便程序使用




