如何实现 图片的放大与缩小??
最好是 这样的接口函数:function fangda(scr:TBitMap):TBitMap;
function suoxia(scr:TBitMap):TBitMap;因为偶的《需求分析》和《概要设计》的接口都已经定型 不想在改
再改这个工程都要改死了!救命啊!
最好是 这样的接口函数:function fangda(scr:TBitMap):TBitMap;
function suoxia(scr:TBitMap):TBitMap;因为偶的《需求分析》和《概要设计》的接口都已经定型 不想在改
再改这个工程都要改死了!救命啊!
解决方案 »
- delphi存放到一个数组里
- 遇上怪事,为什么为什么为什么
- !!!寻求ERP开发兼职人员(delphi 7 + cxGrid + Sql Server)!!!
- 想知道买正版Dephi的代理商
- 杀了我吧,access2000+d7的ADO数据刷新问题,一年前就遇到了
- CBuilder区无人回答,来这里求救。制作ActiveX时的属性,如何保存IDE设计时的值?
- 我用TCPServer和TCPClient组件搞了两个软件,在同一台机器联接正常,如何让他们在Internet上的两台机器联接?
- 关于调试组件的问题,在线等
- 如何捕捉这个错误?
- delphi运行条件提问
- 这个问题已困惑我几天啦,均没人帮我解决真的好盼望呀!!(ADOStoredProc1.Parameters)
- 大哥们:给我介绍几本经典的Dephi各个学习阶段的用书
begin
showmessage('拒绝答题');
end;
通过他可以随心所欲的对原来的图形放大或缩小而且失帧很难看出来,试试吧。例:
bmp.Canvas.CopyRect(Rect(0,0,bmp.Width,bmp.Height),
MyCanvas,Rect(0,0,bmp.Width,bmp.Height),SRC_COPY);//抓图参数说明:
1.Rect()//为你要缩小或放大的区域
2.MyCanvas //你的现在图像存在的画布
3.Rect()//这个为原来画布的区域
最后一点
拷贝到的地方为:bmp.Canvas.CopyRect的参数1的Rect()你自己定义的区域内。
var
i: single;
begin
image1.Cursor := crDefault;
if (sender as TMenuItem).name = 'miZoomIn' then
i := 1.6
else
i := 0.625;
image1.Width := round((image1.Width / image1.Picture.Width * i) *
image1.Picture.Width);
image1.height := round((image1.height / image1.Picture.height * i) *
image1.Picture.height);
if image1.Width >= width then
begin
if image1.Left > 0 then
image1.Left := 0;
image1.Cursor := crHandPoint;
end
else
image1.Left := round((width - image1.Width) / 2);
if image1.height >= height then
begin
if image1.Top > 0 then
image1.top := 0;
image1.Cursor := crHandPoint;
end
else
image1.top := round((height - image1.height) / 2); if image1.Width / image1.Picture.Width > 10 then
miZoomIn.Enabled := false
else
miZoomIn.Enabled := true;
if image1.Width / image1.Picture.Width < 0.1 then
miZoomOut.Enabled := false
else
miZoomOut.Enabled := true;
end;
function suoxia(scr:TBitMap):TBitMap;因为偶的《需求分析》和《概要设计》的接口都已经定型 不想在改
再改这个工程都要改死了!救命啊!
也SETUP了
但 安装好后就不知道 该如何
把 PAS 安装到 DELPHI上
是其中的那个呀?望指导谢谢阿
function TForm1.fangdasuoxia(const scr:TBitMap;bili:double):TBitMap;
var
yheight,ywidth,
hheight,hwidth:Longint;
hrect,yrect:TRect;
begin
yheight:=scr.Height ;
ywidth:=scr.Width ;
hheight:=trunc(yheight*bili);
hwidth:=trunc(ywidth*bili);
Result:=TBitMap.Create ;
yrect:=rect(0,0,ywidth,yheight);
hrect:=rect(0,0,hwidth,hheight);
Result.Canvas.CopyRect(hrect,scr.Canvas,yrect);
end;procedure TForm1.Button1Click(Sender: TObject);
var
bb:TBitMap;
begin
bb:=TBitMap.Create ;
bb.Assign(image1.Picture.Bitmap );
bb:=fangdasuoxia(bb,1/2);
image2.Picture.Bitmap :=bb;
end;
rect(Left-fPictureXPos,Top-fPictureYPos,Right-fPictureXPos,Bottom-fPictureYPos));
放大:
image1.Width:=image1.Width*1.2;
image1.height:=image1.height+1.2;
image1.strech:=true;
form1.update;
帮你顶一下
不是 让IMAGE控件 变化的!