简体   繁体   English

从C#/ WPF中的图像框获取单击的鼠标坐标

[英]Getting the clicked mouse coordinates from a Image Box in C#/WPF

In order to work with an image I need to make the user select certain(4) coordinates within a Image Box and afterwards save that coordinate data and close the window. 为了处理图像,我需要让用户在“图像框”内选择确定(4)坐标,然后保存该坐标数据并关闭窗口。 The project is using C# and WPF. 该项目正在使用C#和WPF。 Sadly google is giving me a lot of unfocused solutions on this topic. 可悲的是,谷歌给了我很多关于这个主题的重点解决方案。 Any suggestions/ links? 有任何建议/链接吗?

thanks 谢谢

Point pos = Mouse.GetPosition(myElement); will give you the mouse position relative to the element. 将为您提供鼠标相对于元素的位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM