使用坐标的图像 [英] Image using Coordinates

查看:133
本文介绍了使用坐标的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从图片中捕获坐标.使用这些坐标,我从数据库中检索了特定图像,然后在另一个图片框中显示该图像.

I want to capture coorinates from a picture. Using those coordinates I retrive the particular image from the database and then display that image in another picturebox.

Dim LocalMousePosition = PictureBox1.PointToClient(Windows.Forms.Cursor.Position)
Label1.Text = ("X=" & LocalMousePosition.X & "," & "Y= " & LocalMousePosition.Y)
Dim x, y As Integer
x = LocalMousePosition.x
y = LocalMousePosition.y
If (x < 45 And y < 50) Then
   MessageBox.Show("clicked on v")

推荐答案

在第一种情况下,您不应为此使用图片框,而应绘制自己的图像,以便控制如何渲染它.其次,您应该给变量赋予有意义的名称.最后,您应该清楚地说明自己.您如何知道要从数据库中获取什么图像?你想做什么 ?您发布的代码不是尝试执行此操作,而是尝试确定是否单击了控件的特定部分.
In the first instance, you should not use a picturebox for this, you should draw your own image so you control hoiw it is rendered. Second, you should give your variables meaningful names. Finally, you should explain yourself clearly. How do you know what image you want to get from the DB ? What are you trying to do ? The code you posted is not an attempt to do this, it''s an attempt to work out if a certain part of the control was clicked.


这篇关于使用坐标的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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