Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Image Co-ordinates

6 views
Skip to first unread message

barry...@gmail.com

unread,
Jan 24, 2005, 4:47:20 AM1/24/05
to
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

Sergey Bogdanov

unread,
Jan 24, 2005, 5:28:18 AM1/24/05
to
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

0 new messages