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. Graphics - removing a line

Graphics - removing a line

Scheduled Pinned Locked Moved C#
graphicsquestion
6 Posts 3 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.
  • Q Offline
    Q Offline
    quilkin
    wrote on last edited by
    #1

    Can anyone explain how I can draw a line over an existing image, then later remove it (by redrawing it in some clever way) without having to invalidate and redraw the original image?

    D M 2 Replies Last reply
    0
    • Q quilkin

      Can anyone explain how I can draw a line over an existing image, then later remove it (by redrawing it in some clever way) without having to invalidate and redraw the original image?

      D Offline
      D Offline
      DavidNohejl
      wrote on last edited by
      #2

      chris fearnley wrote: without having to invalidate and redraw the original image? What's the problem? Do you have double buffering on? David

      Q 1 Reply Last reply
      0
      • D DavidNohejl

        chris fearnley wrote: without having to invalidate and redraw the original image? What's the problem? Do you have double buffering on? David

        Q Offline
        Q Offline
        quilkin
        wrote on last edited by
        #3

        David, Is double buffering relevant? In MFC, I used CDC::SetROP2 to get a whole range of options about combining pixels. I'm trying to find the equivalent in .NET. Thanks for replying.

        D 1 Reply Last reply
        0
        • Q quilkin

          Can anyone explain how I can draw a line over an existing image, then later remove it (by redrawing it in some clever way) without having to invalidate and redraw the original image?

          M Offline
          M Offline
          Mathew Hall
          wrote on last edited by
          #4

          Take a look at ControlPaint.DrawReversibleLine[^] "I think I speak on behalf of everyone here when I say huh?" - Buffy

          1 Reply Last reply
          0
          • Q quilkin

            David, Is double buffering relevant? In MFC, I used CDC::SetROP2 to get a whole range of options about combining pixels. I'm trying to find the equivalent in .NET. Thanks for replying.

            D Offline
            D Offline
            DavidNohejl
            wrote on last edited by
            #5

            chris fearnley wrote: Is double buffering relevant? Well, no :). You wrote "(by redrawing it in some clever way) without having to invalidate and redraw the original image?" so I thought that you have performance problem... There was a chance that with double buffering you won't need "clever way" to do it. Back on topic, if ControlPaint.DrawReversibleLine suggested by Mathew won't work for you, maybe you can interop with GDI. http://pinvoke.net/default.aspx/gdi32/SetROP2.html[^]. It look like there isn't managed solution, but then again I am no GDI/DGI+ expert :). David

            Q 1 Reply Last reply
            0
            • D DavidNohejl

              chris fearnley wrote: Is double buffering relevant? Well, no :). You wrote "(by redrawing it in some clever way) without having to invalidate and redraw the original image?" so I thought that you have performance problem... There was a chance that with double buffering you won't need "clever way" to do it. Back on topic, if ControlPaint.DrawReversibleLine suggested by Mathew won't work for you, maybe you can interop with GDI. http://pinvoke.net/default.aspx/gdi32/SetROP2.html[^]. It look like there isn't managed solution, but then again I am no GDI/DGI+ expert :). David

              Q Offline
              Q Offline
              quilkin
              wrote on last edited by
              #6

              ControlPaint.DrawReversibleLine works fine. A whole new class I didn't know about. Thanks to all.:)

              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