得到x&图片盒中图像的y [英] get x & y of an image in a picturebox

查看:96
本文介绍了得到x&图片盒中图像的y的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!
我在图片框(Windows窗体)中有一个图像,我想在它的特定点上画一个圆,我该如何获得该点?
我使用Mouse Move事件,但是在错误的位置绘制了圆圈!

Hi!
I have an image in a picturebox(windows form) I want to draw a circle on specific point of it how can I get that point?
I use Mouse Move event but the circle is drawn in wrong point!

推荐答案

好吧,告诉我们它的绘制在错误的位置"不会告诉我们任何事情.相对于PictureBox控件的左上角/左上角-而不是图像.
Well, telling us it''s "drawn at the wrong point" doesn''t tell us anything. The point is (or should be) in relation to the top/left corner of the PictureBox control - not the image.


您似乎正在尝试进行一些交互在PictureBox上绘图.在这种情况下,类PictureBox完全没有帮助,与仅自定义控件,面板或窗体相比,它仅增加了一些麻烦,并且没有任何额外的价值.

该怎么办:
如何从旧图纸中清除面板 [ ^ ].

使用这种方法,您可以轻松完成PictureBox的所有工作,而且性能更高.如果您遇到任何问题,请提出后续问题.

—SA
It looks like you''re trying to do some interactive drawing on PictureBox. In this case, the class PictureBox is not helpful at all, it only adds some hassles and no extra value compared to just custom control, panel or form.

This is what to do:
How do I clear a panel from old drawing[^].

With this approach, you can do absolutely all what you would do with PictureBox, only easier and with better performance. If you face any problems, please ask your follow-up questions.

—SA


我找到了答案!
应该是:
pictureBox.mode = normal
I found the answer!
It should be:
pictureBox.mode=normal


这篇关于得到x&图片盒中图像的y的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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