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. GDI+:How to clear the graphic?

GDI+:How to clear the graphic?

Scheduled Pinned Locked Moved C#
graphicstutorialwinformsquestion
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.
  • D Offline
    D Offline
    dreamwinter
    wrote on last edited by
    #1

    For example,I draw a line on the surface of graphics with GraphicsPath. Sometime I want to clear the line,how should I do?:^)

    D 1 Reply Last reply
    0
    • D dreamwinter

      For example,I draw a line on the surface of graphics with GraphicsPath. Sometime I want to clear the line,how should I do?:^)

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      If you want to clear the entire entire canvas, just call your Graphics object's .Clear() method. If you want to clear just the line itself, you'll have to create a new pen the same color as the canvas background, then use it to redraw the line exactly the same way it was drawn originally. If your line intersects with other lines or graphics objects, it'll draw a background colored loine through them. The only other way to do this would be to redraw everything onto the canvas that was originally drawn, but don't draw the line that you want to erase. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      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