I'm having trouble on how am going to start this idea of mine. I have an image and I want to plot points on that image. My Idea is to get the X and Y coordinates of the mouse pointer and save it into a text file so that by the time I re-run the program again, the plotted points is still there. But it seems like this is not a good idea since everything will be messed up if I load the program to a computer with different screen size. I was thinking of placing an invisible grid, but looks like this will be tough to do.

Recommended Answers

All 2 Replies

You could look at this snippet http://www.daniweb.com/code/snippet1020.html
It uses coordinate transformations, so you are independent of a screen.
You can have an invisible grid by adding a form with FormBorderStyle set to none and Opacity set to zero Be carefull you must provide another way to close this form than the usual closebox because there isn't one.

Well, you could create a 2D array to resemble the grid. When someone clicks on the mouse, you could take the mouse pointer (relative to the window not the screen) and convert it to the position in your array. You could even create a nice little collection class to store the grid and then simply serialize it when you need to store the grid.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.