|
|
导航: |
论坛 -> DELPHI技术
斑竹:liumazi,sephil |
|
作者: |
mtmt (mt) |
★☆☆☆☆ |
-
|
盒子活跃会员 |
|
2004/3/2 9:43:00 |
标题: |
|
加入我的收藏 |
楼主: |
因为jpg图片的尺寸比较大,要把它缩小,并存成文件,很长时间也找不到解决的办法,恳请大师不吝赐教!非常感谢!
----------------------------------------------
- |
作者: |
sephil (NAILY Soft) |
★☆☆☆☆ |
-
|
盒子中级会员 |
|
2004/3/2 10:03:38 |
2楼: |
下面的代码将Image1的图片缩小50%,并转换为JPEG格式
procedure TForm1.Button1Click(Sender: TObject); var B: TBitmap; J: TJPEGImage; begin B := TBitmap.Create; try B.Assign(nil); B.Width := Image1.Picture.Graphic.Width div 2; B.Height := Image1.Picture.Graphic.Height div 2; B.Canvas.StretchDraw(B.Canvas.ClipRect, Image1.Picture.Graphic);
J := TJPEGImage.Create; try J.Assign(B); // 对缩小的 JPEG做处理,比如保存什么的 finally J.Free; end; finally B.Free; end; end;
----------------------------------------------
Copyright 2008 ? NAILY Soft Click here to redirect to my home Click here to redirect to my blog
|
作者: |
mtmt (mt) |
★☆☆☆☆ |
-
|
盒子活跃会员 |
|
2004/3/2 10:24:20 |
3楼: |
大哥,再次谢你!如不嫌弃,请收下小弟!
----------------------------------------------
-
|
|