Click here to Skip to main content
16,002,635 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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.

VB
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")
Posted
Updated 20-May-10 7:52am
v2
Comments
TheyCallMeMrJames 20-May-10 10:54am    
You're going to need to be a little more clear, here, Rakulu.

Are you trying to create an image map? Do you have one picture that is a composition of several pictures and, when clicked, you want to look up another image in the database?

What is the issue, then? Are you looking for database code? Are you looking for the math to compute which picture was clicked?
William Winner 20-May-10 12:22pm    
Reason for my vote of 1
What is your question?

By the way, the post title is supposed to be short and sweet...like "Display picture from database" then you ask the full question in the body.

Nobody understands what you are asking!

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900