Layout /map [modified]
-
I have been tasked with creating a windows form that will be like a paint program. The user should be able to drag units from a toolbox and drop them on the map. Then be able to resize them and move them around on the map. This way they create a map over their facility with storage units. I have never developed much GDI+ related stuff and i have no clue how to do this. Can someone please hint me where i can find some good articles on how to place items like this on a surface and then move them around. Thanks for any help. -- modified at 14:07 Monday 20th August, 2007
-
I have been tasked with creating a windows form that will be like a paint program. The user should be able to drag units from a toolbox and drop them on the map. Then be able to resize them and move them around on the map. This way they create a map over their facility with storage units. I have never developed much GDI+ related stuff and i have no clue how to do this. Can someone please hint me where i can find some good articles on how to place items like this on a surface and then move them around. Thanks for any help. -- modified at 14:07 Monday 20th August, 2007
This is not a paint program, it's a drawing program. The difference is that when you paint, you leave behind pixels, when you draw, you leave shapes that you can then interact with. Basically, what you want to do is store a collection of a base shape class, and create derived classes for the shapes you draw. Then when you move the mouse, you need to iterate over those shapes to work out if the mouse is over one. If it is, you start using mouse actions to interact with the shape in question. Changing that instance of a shape class, obviously then changes how it is drawn on screen. GDI+ actually does very little here, each shape knows how to draw itself, and presumably the drawings are not that complex. The real work is in working out what shape the mouse is over, and manipulating it.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )