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. How to avoid flickering problem when drawing?`

How to avoid flickering problem when drawing?`

Scheduled Pinned Locked Moved C#
csharpgraphicshelptutorialquestion
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.
  • R Offline
    R Offline
    radic feng
    wrote on last edited by
    #1

    Hi, guys, I am now developing a drawing program in C#. Everytime when adding new lines, ellipse or other shapes, I have to use "this.Invalidate(); this.Update();" to refresh the drawing area then new shapes will appear. However, it has to paint all the shapes I drew before, or the shapes I drew before may be erased! But everytime redrawing every shape causes terribly flicking! How to avoid this? Can it only draw newly-drawn shape? ps: I use ControlStyles.DoubleBuffer and ControlStyles.UserPaint. The effect is not obvious. Many thanks! Radic Beijing, China -- modified at 21:25 Sunday 28th August, 2005

    C 1 Reply Last reply
    0
    • R radic feng

      Hi, guys, I am now developing a drawing program in C#. Everytime when adding new lines, ellipse or other shapes, I have to use "this.Invalidate(); this.Update();" to refresh the drawing area then new shapes will appear. However, it has to paint all the shapes I drew before, or the shapes I drew before may be erased! But everytime redrawing every shape causes terribly flicking! How to avoid this? Can it only draw newly-drawn shape? ps: I use ControlStyles.DoubleBuffer and ControlStyles.UserPaint. The effect is not obvious. Many thanks! Radic Beijing, China -- modified at 21:25 Sunday 28th August, 2005

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

      You need to look into double buffering. You can actually set up C# to do this for you, just google double buffer C# and you're sure to find plenty of info. Christian Graus - Microsoft MVP - C++

      R 1 Reply Last reply
      0
      • C Christian Graus

        You need to look into double buffering. You can actually set up C# to do this for you, just google double buffer C# and you're sure to find plenty of info. Christian Graus - Microsoft MVP - C++

        R Offline
        R Offline
        radic feng
        wrote on last edited by
        #3

        Thanks, Christian! Absolutely you are the most warm-hearted!

        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