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. double buffering for flickering problem

double buffering for flickering problem

Scheduled Pinned Locked Moved C#
helpgraphicsquestion
3 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.
  • C Offline
    C Offline
    cyn8
    wrote on last edited by
    #1

    Hi, i have a form with a panel. In this panel, it allow the shapes drawn (using graphicspath) to be drag and drop. However, there is the flickering problem whenever i drag any of the shapes. i tried to use the SetStyle function like below: public class DoubleBufferPanel : Panel { public DoubleBufferPanel() { // Set the value of the double-buffering style bits to true. this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint |ControlStyles.AllPaintingInWmPaint, true); this.UpdateStyles(); } } however, it generates the error below: An unhandled exception of type 'System.ArgumentException' occurred in system.drawing.dll Additional information: Invalid parameter used. Any suggestion on what should i do? Thanks in advance

    M L 2 Replies Last reply
    0
    • C cyn8

      Hi, i have a form with a panel. In this panel, it allow the shapes drawn (using graphicspath) to be drag and drop. However, there is the flickering problem whenever i drag any of the shapes. i tried to use the SetStyle function like below: public class DoubleBufferPanel : Panel { public DoubleBufferPanel() { // Set the value of the double-buffering style bits to true. this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint |ControlStyles.AllPaintingInWmPaint, true); this.UpdateStyles(); } } however, it generates the error below: An unhandled exception of type 'System.ArgumentException' occurred in system.drawing.dll Additional information: Invalid parameter used. Any suggestion on what should i do? Thanks in advance

      M Offline
      M Offline
      Martin 0
      wrote on last edited by
      #2

      Hello, I would assume that the exception is not accuring in the classes constructor. Have you overriden the "OnPaint" method? Please show us more code and do some debugging!

      All the best, Martin

      1 Reply Last reply
      0
      • C cyn8

        Hi, i have a form with a panel. In this panel, it allow the shapes drawn (using graphicspath) to be drag and drop. However, there is the flickering problem whenever i drag any of the shapes. i tried to use the SetStyle function like below: public class DoubleBufferPanel : Panel { public DoubleBufferPanel() { // Set the value of the double-buffering style bits to true. this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint |ControlStyles.AllPaintingInWmPaint, true); this.UpdateStyles(); } } however, it generates the error below: An unhandled exception of type 'System.ArgumentException' occurred in system.drawing.dll Additional information: Invalid parameter used. Any suggestion on what should i do? Thanks in advance

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        Hi, you must use the line numbers: - tell Visual to show line numbers (see my sig, tip 1) - look at the exception's line numbers (see my sig, tip 2) Good luck !

        Luc Pattyn [Forum Guidelines] [My Articles]


        this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google


        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