如何将图片放大或缩小?
图片已放在image中,如果不通过image控件的放大与缩小,如何实现?
图片已放在image中,如果不通过image控件的放大与缩小,如何实现?
解决方案 »
- 关于提高代码复用效率【大家说说】
- listview 如何按列显示?
- 我想作一个托盘服务程序,功能包括与我的特定程序的时时数据交流,还有与服务器的时时连接,请问谁有这方面的东东,给我说说好么
- 如何在SQL语句里精确小数点以后的位数不清
- 错在哪里
- WEBBROWSER控件去边框
- Delphi怎么实现文件加密和解密
- 如何取得sql语句中每个分组结果的最后一条记录!内详,高手请赐教!
- 急!!!服务器上面的数据下载下来以后,在客户端以怎样的形式存储
- 超难sql表abd 字段 name(名称) oldcount(原先数量) nowcount(现在数量) gcount(放声数量) why(发生原因) id(流水编码)
- 關於quickreport和rave?請高手指點,謝謝!!
- 请教有关DBChart的两个问题?
DestRect:TRect;
SourceRect:Trect;
begin
With DestRect do
begin
Top:=0;
Left:=0;
Right:=Image2.Width;
Bottom:=Image2.Height;
end;
With SourceRect do
begin
Top:=0;
Left:=0;
Right:=Image1.Width;
Bottom:=Image1.Height;
end;
image2.Canvas.CopyRect(DestRect,Image1.Canvas,SourceRect);//CopyRect
StretchBlt(Image2.Canvas.Handle,0,0, Image2.Width,Image2.Height,
Image1.Canvas.Handle,0,0,
Image1.Width, Image1.Height,SrcCopy);//StretchBlt
它的功能是什么?
上面的写错了
http://expert.csdn.net/Expert/topic/2841/2841286.xml?temp=.5164453
jpg :TJpegImage;
bmp1,bmp2 :TBitmap;
x1,y1,x2,y2,x0,y0,dx,dy,x,y:integer;
begin
jpg :=TJpegImage.Create;
jpg.LoadFromFile('未命名.jpg');
bmp1 :=TBitmap.Create;
bmp2 :=TBitmap.Create;
bmp1.Assign(jpg); //改变后的的 Size
bmp2.Width:=112;
bmp2.Height:=98; x1:=bmp1.Width;
y1:=bmp1.Height;
x2:=bmp2.Width;
y2:=bmp2.Height;
dx:=0;
x0:=0;
for x:=0 to bmp2.Width-1 do
begin
dy:=0;
y0:=0;
dx:=dx+x1; while (dx>=x2) do
begin
x0:=x0+1;
dx:=dx-x2;
end; for y:=0 to bmp2.Height-1 do
begin dy:=dy+y1;
while (dy>=y2) do
begin
y0:=y0+1;
dy:=dy-y2;
end;
bmp2.Canvas.Pixels[x,y]:=bmp1.Canvas.Pixels[x0,y0];
end;
end; jpg.Assign(bmp2);
jpg.SaveToFile('未命名1.jpg');
jpg.Free;
bmp1.Free;
bmp2.Free;end;