procedure TForm1.FormMouseWheelDown(Sender: TObject; Shift: TShiftState;
MousePos: TPoint; var Handled: Boolean);
var
r:TRect;
begin
R := BoundsRect;
ChangeScale(Self.Width,Round(Self.Width*1.04));
SetBounds(R.Left, R.Top, Width, Height);
// self.SetBounds(self.Left,Top,Round(Self.Width*1.04)+self.left,Round(Self.Height*1.04)+self.height);
//Self.ScaleBy(Self.Height,Round(Self.Height*1.04));
//Self.ChangeScale(Self.Width,Round(Self.Width*1.04));
// Self.Height:=Round(Self.Height*1.04);
// Self.Width:=Round(Self.Width*1.04);
Application.ProcessMessages;
getpic;
end;
procedure TForm1.getpic();
var
i:Integer;
begin
begin
if OpenDialog1.FileName='' then Exit;
try
pic:=TGPImage.Create(OpenDialog1.FileName);
if firstopen then
begin
Self.Width:=pic.Width;
Self.Height:=pic.Height;
firstopen:=False;
g:=TGpGraphics.Create(Self.Handle);
end;
g.DrawImage(pic, 0,0, Self.Canvas.ClipRect.Right-Self.Canvas.ClipRect.Left,
Self.Canvas.ClipRect.Bottom-Self.Canvas.ClipRect.Top);
end;end;
MousePos: TPoint; var Handled: Boolean);
var
r:TRect;
begin
R := BoundsRect;
ChangeScale(Self.Width,Round(Self.Width*1.04));
SetBounds(R.Left, R.Top, Width, Height);
// self.SetBounds(self.Left,Top,Round(Self.Width*1.04)+self.left,Round(Self.Height*1.04)+self.height);
//Self.ScaleBy(Self.Height,Round(Self.Height*1.04));
//Self.ChangeScale(Self.Width,Round(Self.Width*1.04));
// Self.Height:=Round(Self.Height*1.04);
// Self.Width:=Round(Self.Width*1.04);
Application.ProcessMessages;
getpic;
end;
procedure TForm1.getpic();
var
i:Integer;
begin
begin
if OpenDialog1.FileName='' then Exit;
try
pic:=TGPImage.Create(OpenDialog1.FileName);
if firstopen then
begin
Self.Width:=pic.Width;
Self.Height:=pic.Height;
firstopen:=False;
g:=TGpGraphics.Create(Self.Handle);
end;
g.DrawImage(pic, 0,0, Self.Canvas.ClipRect.Right-Self.Canvas.ClipRect.Left,
Self.Canvas.ClipRect.Bottom-Self.Canvas.ClipRect.Top);
end;end;
解决方案 »
- delphi下dll中调用dll如何发布到别的机器也能正常运行?
- 关于TChart控件的若干问题,请教各位大哥,急。。。。
- 如何使数据库表某一字段的内容显示在文本框和mome控件里?
- 在线等D7+SQL SERVER 2000的问题.
- 你一定知道怎么解答这个问题,帮帮忙
- 无法找到对象???很奇怪o,请高人指点!!!
- sqlserver数据库,有1,2百万记录, 用什么方法查询可以速度最快??
- 网络编程高手指教
- 能够将Delphi的.Frm文件动态加入程序中吗?
- 在安装ZIPtv组件时,Delphi出现"file not found dsgnint.dcu",请各位给以指点!
- delphi 将数据库内容生成word文档
- 虚拟桌面原理及实现
不过自己在做的时候,始终无法十全十美; 我无法实现的功能:
1:图片无限放大 [其实也不算无限,就是尽量放大]
2:窗体的top 不能超越顶部;总是被弹回来
3:....