在多尺度图像上绘制的形状可防止图像鼠标事件.如何解决? [英] Shapes drawn on multiscale image prevent image mouse events. How to fix it?

查看:62
本文介绍了在多尺度图像上绘制的形状可防止图像鼠标事件.如何解决?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在包含多尺度图像的画布中绘制了一条闭合路径.因此,闭合路径绘制在多尺度图像上.但是,当鼠标指针位于闭合路径上时,多尺度图像MouseMove和MouseWheel事件不起作用.多尺度图像鼠标事件仅在路径外部的图像位置起作用.如何使多尺度图像鼠标事件在封闭路径中起作用?

预先感谢您的帮助,

Luis Nambiar

Hi All,

I have drawn a closed path in a canvas that contains a multiscale image. So the closed path is drawn over the multiscaleimage. However, the multiscale image MouseMove and MouseWheel events do not work when the mouse pointer is over the closed path. The multiscale image mouse events only work in the image places outside the path. How to make the multiscale image mouse events work in the closed path?

Thanks in advance for your help,

Luis Nambiar

推荐答案

我最近不得不处理这个完全相同的问题.我发现的快速解决方案是将鼠标事件传递给multiscaleimage的适当鼠标事件处理程序.如果满足要求,这还可以使您执行任何特定形状的鼠标功能,如果不满足要求,则可以将事件传递给multiscaleimage以进行正常的鼠标处理.

或者,如果您希望形状完全忽略鼠标,并且只是出于渲染目的而存在,则可以分配形状鼠标事件以使用multiscaleimage的相应鼠标事件处理程序.

IE. Shape.MouseWheel ="ZoomImage_OnMouseWheel";
I recently had to deal with this exact same problem. The quick solution that I found was to pass the mouse event to the multiscaleimage''s appropriate mouse event handler. This would also allow you to perform any shape specific mouse functionality if the requirements were met, and pass the event to the multiscaleimage for normal mouse processing if not.

Or, if you want the shape to completely ignore the mouse and just be there for render purposes you could assign the shapes mouse events to use the multiscaleimage''s corresponding mouse event handlers.

ie. Shape.MouseWheel = "ZoomImage_OnMouseWheel";


这篇关于在多尺度图像上绘制的形状可防止图像鼠标事件.如何解决?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆