图片文件格式转化 在delphi中,如何通过编程实现把bmp位图文件转化为jpg文件,不使用dialog控件,希望大家多指教 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://delphi.ktop.com.tw/topic.asp?TOPIC_ID=32810BMP與JPG圖檔的互轉函式 【編輯】領航天使 【作者】領航天使【內文】提供兩個函式Bmp2JPG與JPG2BMP.function Bmp2JPG(BmpFileName,JPGFileName:string;CompressRate:integer=86):boolean;將BMP圖檔轉為JPG圖檔,BMP檔名為BmpFileName,JPG檔名為JPGFileName,CompressRate為JPG圖檔的壓縮率,若不傳入此參數內定為86%壓縮率.function JPG2BMP(JPGFileName,BmpFileName:string):boolean;將JPG圖檔轉為BMP圖檔,JPG檔名為JPGFileName,BMP檔名為BmpFileNamefunction Bmp2JPG(BmpFileName,JPGFileName:string;CompressRate:integer=86):boolean;var jpg:TJPEGImage; bmp:tBitMap;begin jpg:=TJPEGImage.create; bmp:=TBitMap.create; result:=true; try bmp.LoadFromFile(BmpFileName); jpg.assign(bmp); jpg.CompressionQuality:=CompressRate; jpg.SaveToFile(JPGFileName); except result:=false; end; jpg.free; bmp.free;end;function JPG2BMP(JPGFileName,BmpFileName:string):boolean;var jpg:TJPEGImage; bmp:tBitMap;begin jpg:=TJPEGImage.create; bmp:=TBitMap.create; result:=true; try jpg.loadfromfile(JPGFileName); bmp.assign(jpg); bmp.SaveToFile(BmpFileName); except result:=false; end; jpg.free; bmp.free;end; 搞定,语法写错了,应该是:dw_2.modify('datawindow.crosstab.staticmode=yes') Delphi在RichEdit中能否插入一些图片 新手问题 listbox 动态图标 ACCESS2003能不能储存图片文件数据? 简单中蕴藏着不简单 控制word,选择那种方法最好? 小迪,拿分吧 在bt上下载了一些rmvb格式的电影,用什么看? 大侠,帮个忙好吗? 怎么样实现ip地址的输入格式!就像微软的ip设置的那样输入框 Delphi帮助文件中怎么找不到字符串函数? ShellExecute奇怪的问题 教你如何用一块钱赚到10亿(转载)
BMP與JPG圖檔的互轉函式 【編輯】領航天使
【作者】領航天使
【內文】提供兩個函式Bmp2JPG與JPG2BMP.function Bmp2JPG(BmpFileName,JPGFileName:string;CompressRate:integer=86):boolean;
將BMP圖檔轉為JPG圖檔,BMP檔名為BmpFileName,JPG檔名為JPGFileName,CompressRate為JPG圖檔的壓縮率,若不傳入此參數內定為86%壓縮率.function JPG2BMP(JPGFileName,BmpFileName:string):boolean;
將JPG圖檔轉為BMP圖檔,JPG檔名為JPGFileName,BMP檔名為BmpFileNamefunction Bmp2JPG(BmpFileName,JPGFileName:string;CompressRate:integer=86):boolean;
var jpg:TJPEGImage;
bmp:tBitMap;
begin
jpg:=TJPEGImage.create;
bmp:=TBitMap.create;
result:=true;
try
bmp.LoadFromFile(BmpFileName);
jpg.assign(bmp);
jpg.CompressionQuality:=CompressRate;
jpg.SaveToFile(JPGFileName);
except
result:=false;
end;
jpg.free;
bmp.free;
end;
function JPG2BMP(JPGFileName,BmpFileName:string):boolean;
var jpg:TJPEGImage;
bmp:tBitMap;
begin
jpg:=TJPEGImage.create;
bmp:=TBitMap.create;
result:=true;
try
jpg.loadfromfile(JPGFileName);
bmp.assign(jpg);
bmp.SaveToFile(BmpFileName);
except
result:=false;
end;
jpg.free;
bmp.free;
end;
dw_2.modify('datawindow.crosstab.staticmode=yes')