Delphi组件中的鼠标滚轮事件
我想写一个使用鼠标滚轮缩放的组件 类似于谷歌地球的东西。
我有一个使用 onMouseWheel 的组件,并且有属性 MaxZoom MinZoom 和 Zoom 有一个更好的选择,即带有位图的 StretchDraw 我正在尝试以表格形式获取组件区域的位置
据我所知,我必须找到每个父级,直到我找到 tCustomform 并添加所有组件的顶部和左侧组件以获取对象位置以找到我的对象位置。 有更好的方法
一旦我有了位置,如果鼠标位于我的对象上方以及从哪里缩放,我可以从鼠标光标位置缩放地图,是否
。请问有人见过任何代码吗
I'm wanting to write a component that uses the mouse wheel to zoom
something similar to Google earth.
I have a component using onMouseWheel and I have properties MaxZoom MinZoom and Zoom there is a better option that StretchDraw with the bitmap I'm trying to get the location of the components area in the form
What I understand I have to find each parent until I find the tCustomform and add all Component's top and components left to get the objects location to find my objects location. is there a better way
once I have the location I can zoom a Map from the mouse cursor location if the mouse is over my object and where to zoom from.
has any one seen any code please
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您正在编写组件,那么您应该尝试重写组件中的这两个方法:
它们是 TControl 的受保护动态方法。每当鼠标滚轮旋转时,它们就会被调用。
If you are writing a component then you should try overriding these 2 methods in your component:
which are protected dynamic methods of TControl. They get called whenever the mouse wheel is rotated.
这取决于您要缩放的内容类型;
我只会在这里发布如何
私有声明上
在创建或任何其他启动过程中的
获取轮子移动了多长时间FormMouseWheel 像这样
我使用 vcl 表单(不在组件内部)检查它,
如果您想缩放,请将您想要缩放的内容告诉我们
It depends on what kind of content you are going to zoom ;
I will only Post here how to get how long the wheel has moved
on private declaration
on create or any other starting procedure
The FormMouseWheel comes like this
I checked it using vcl form (not inside component ),
If You want to zoom post us what kind of content you want to zoom