请问怎么样才能实现,在一个IMAGE中,当移动到图片的边缘的时候,可以按照比例放大缩小,或者任意放大和缩小,当鼠标移动到图片上面的时候可以拖动图片?
解决方案 »
- delphi如果访问url 管理 session
- 关闭子窗口
- 关于IShellWindows在Vista下的问题
- 哪位高手有空帮我翻译下面藏文内容
- 能提供一点编写“俄罗斯方块”的算法和思路吗?
- 哪里有支持jpg的image倥件下载(马上给分)!!!!!
- 关于Delphi控制Excel,如何控制数值的小数点位数
- 菜鸟提问,locate()重复查找??急用!!!!在线等待。
- 幸福来的太突然,太多了,真高兴(另附报表打印问题)
- 16进制在delphi代码里面是怎么写的啊 还有 有相关把字符转化为asc的函数吗?
- 关于组件问题,谁解决相送100分,并感激不尽!
- 极度不爽,散分。--硬盘中了恶性程序,删了文件
[email protected]
用这个信箱吧[email protected]
[email protected]
//放大
procedure TfrmPicView.N1Click(Sender: TObject);
var
i:single;
begin
image1.Cursor := crDefault;
if (sender as TMenuItem).name = 'N1' 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
n1.Enabled := false
else
n1.Enabled := true;
if image1.Width / image1.Picture.Width < 0.1 then
n2.Enabled := false
else
n2.Enabled := true;
end;//缩小
procedure TfrmPicView.N1Click(Sender: TObject);
var
i:single;
begin
image1.Cursor := crDefault;
if (sender as TMenuItem).name = 'N1' 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
n1.Enabled := false
else
n1.Enabled := true;
if image1.Width / image1.Picture.Width < 0.1 then
n2.Enabled := false
else
n2.Enabled := true;
end;
万分感谢!!
[email protected]
或[email protected]@sina.com