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 / C++ / MFC
  4. GDI+ drawings on background image

GDI+ drawings on background image

Scheduled Pinned Locked Moved C / C++ / MFC
graphicswinformshelptutorialquestion
3 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.
  • _ Offline
    _ Offline
    _NielsB
    wrote on last edited by
    #1

    Im trying to implement something like that: the user should be able to draw some graphical objects to a CWnd, that allready holds a Bitmap. I tried to realize this by using GDI+ ... storing the Objects as GraphicsPath in a List and draw them by using Graphics::DrawPath(...). Works fine so far. Problem: how to implement undo and clear functionallity? I tried to use Graphics::Clear(...) to 'empty the Window' and repaint all remaining Objects. But this will also reset the background-image ... but the background should _not_ be manipulated. So i thought about using some kind of layer, but really dont know how to start. Any hints / suggestions / keywords? Thanks in advance _NielsB

    C 1 Reply Last reply
    0
    • _ _NielsB

      Im trying to implement something like that: the user should be able to draw some graphical objects to a CWnd, that allready holds a Bitmap. I tried to realize this by using GDI+ ... storing the Objects as GraphicsPath in a List and draw them by using Graphics::DrawPath(...). Works fine so far. Problem: how to implement undo and clear functionallity? I tried to use Graphics::Clear(...) to 'empty the Window' and repaint all remaining Objects. But this will also reset the background-image ... but the background should _not_ be manipulated. So i thought about using some kind of layer, but really dont know how to start. Any hints / suggestions / keywords? Thanks in advance _NielsB

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

      _NielsB wrote: Problem: how to implement undo and clear functionallity? There's a few ways to do this. The easiest, and ugliest is to keep bitmaps in memory for each action. However, seeing as you're saying the background should not be manipulated, I think you should build an action list, and apply it in your paint handler. Then, undo just means taking the top item out of the list. Christian Graus - Microsoft MVP - C++

      _ 1 Reply Last reply
      0
      • C Christian Graus

        _NielsB wrote: Problem: how to implement undo and clear functionallity? There's a few ways to do this. The easiest, and ugliest is to keep bitmaps in memory for each action. However, seeing as you're saying the background should not be manipulated, I think you should build an action list, and apply it in your paint handler. Then, undo just means taking the top item out of the list. Christian Graus - Microsoft MVP - C++

        _ Offline
        _ Offline
        _NielsB
        wrote on last edited by
        #3

        :) think that will work! thanks

        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