Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Layout /map [modified]

Layout /map [modified]

Scheduled Pinned Locked Moved C#
winformsgraphicshelptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SpiveyC
    wrote on last edited by
    #1

    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

    C 1 Reply Last reply
    0
    • S SpiveyC

      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

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      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 )

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups