Image Co-ordinates

  • Thread starter Thread starter barry.burke
  • Start date Start date
B

barry.burke

On the device i want to have an image eg a floor plan.
The image will remain the same and never change.

I want to be able to determine what area of the image that the user has
selected.
In this case which room was selected.

So i presume it will involve obtaining the co-ordinates from the image
and comparing these to be between certain values for each area.

Any advice on the best way to do this would be very helpful
thanks guys
 
You may organize array of rectangles that will contain all areas that
will be watched by your application. Something like this:

void pictureBox1_Click(...)
{
// setting up watching rectangle
Rectangle yourWatchedArea = new Rectangle(0, 0, 10, 10);
Point p = pictureBox1.PointToClient(MousePosition);
if (r.Contains(p.X, p.Y)) MessageBox.Show("Watching area!");
}


Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top