如何缩小一个图片的分辨率? 我想把普通机器上的图片(比如JPEG格式)上传到网上,然后让PDA能访问到我如何把一个800*600的分辨率缩小为300*200后再上传上去谢谢了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 uses Graphics, JPEG;procedure ZoomImage(var JpegImage: TJpegImage; SetWidth: integer; SetHeight: integer); implementationfunction BmpToJpg(var Value: TBitmap): TJpegImage;begin Result := nil; if Assigned(Value) then begin Result := TJpegimage.Create; Result.Assign(Value); Result.CompressionQuality := 70; Result.JPEGNeeded; Result.Compress; end;end;procedure ZoomImage(var JpegImage: TJpegImage; SetWidth: integer; SetHeight: integer); overload;var BitMapTmp, Bitmap: TBitmap;begin JpegImage.DIBNeeded; Bitmap := TBitmap.Create; try Bitmap.Assign(JpegImage); JpegImage.Free; BitMapTmp := TBitmap.Create; try BitMapTmp.Assign(BitMap); Bitmap.Width := SetWidth; Bitmap.Height := SetHeight; Bitmap.Canvas.StretchDraw(Bitmap.Canvas.ClipRect, BitMapTmp); finally BitMapTmp.Free; end; JpegImage := BmpToJpg(Bitmap); finally Bitmap.Free; end;end;调用ZoomImage就行了 cnpack怎么查看窗体里所有的事件 listview中只读和编辑的问题 那位高手能详细讲一下COM+是什么东西,怎么写程序(越详细越好,要实战性的)? 跪求 发送EMAIL 的原码或例子,谢谢!!! 两段正确的代码在一起就变成错的了。 wise制作安装文件的问题 delphi7中Rave reports怎么显示成横向的? 如何用WNetOpenEnum,100分,可以加分! 问一个关于delphi 绘图的问题 哪为大侠知道如何把real转变为string 如何动创建Tabel某个字段的OnChange事件? 用adoquery取出某条记录值的问题
Graphics, JPEG;procedure ZoomImage(var JpegImage: TJpegImage; SetWidth: integer; SetHeight:
integer); implementationfunction BmpToJpg(var Value: TBitmap): TJpegImage;
begin
Result := nil;
if Assigned(Value) then
begin
Result := TJpegimage.Create;
Result.Assign(Value);
Result.CompressionQuality := 70;
Result.JPEGNeeded;
Result.Compress;
end;
end;procedure ZoomImage(var JpegImage: TJpegImage; SetWidth: integer; SetHeight:
integer); overload;
var
BitMapTmp, Bitmap: TBitmap;
begin
JpegImage.DIBNeeded;
Bitmap := TBitmap.Create;
try
Bitmap.Assign(JpegImage);
JpegImage.Free;
BitMapTmp := TBitmap.Create;
try
BitMapTmp.Assign(BitMap);
Bitmap.Width := SetWidth;
Bitmap.Height := SetHeight;
Bitmap.Canvas.StretchDraw(Bitmap.Canvas.ClipRect, BitMapTmp);
finally
BitMapTmp.Free;
end;
JpegImage := BmpToJpg(Bitmap);
finally
Bitmap.Free;
end;
end;
调用ZoomImage就行了