Making a moveable rectanlge on top of an image

This is a discussion on Making a moveable rectanlge on top of an image within the Windows Programming forums, part of the Platform Specific Boards category; Hey
I am working on a small program where I need to be able to place rectangles on top of ...

Making a moveable rectanlge on top of an image

Hey

I am working on a small program where I need to be able to place rectangles on top of an image. The rectangles has to be able to be move and scaled using the mouse. What is the best way to do this?

I was thinking of storing the coordinates of each rectangle, and every time the mouse is pressed inside the image I do a check against the coordinates to see if the mouse is inside one of the rectangles. And I would draw then using a brush on top of the image. But to me this does not sound like a very good way of doing this, so I am wondering if its a better way I could go about it?