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. Windows Forms
  4. Flickering Problem [modified]

Flickering Problem [modified]

Scheduled Pinned Locked Moved Windows Forms
wpfgraphicshelpquestion
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.
  • G Offline
    G Offline
    geali_dor
    wrote on last edited by
    #1

    Hey there, i am programming a charting Libary for my Financial Suit. Therefore my idea was to have a Panel that has Lists of all my shapes (Line, Pie, Bar etc.) Wenn i resize my Panel the whole shapes are flickering very much. i googled and codeprojected a few days but i got no satisfying answer.

    Control.SetStyle(ControlStyles.OptimizedDoubleBuffer, true)

    ...does unfortunately not work, because, when i set this style, the shapes only appeare frequently on resizing, but when the resizing is finished (MouseUp) the Panel is empty (white; and if i override the OnPaintBackgound and comment the base.OnPaintBackgound out it is black) Does anyone know about this problems or had the same? Do i need some more Styles etc? Do i have to override some methods or properties? [Edit] Hey there, i finally figured it out: the problem is, if i use Control.SetStyle(ControlStyles.OptimizedDoubleBuffer, true) and an object uses Control.CreateGraphics() it will only be painted while resizing and not when resizing is finished! Now i'm using public void Draw(Graphics g) instead of public void Draw(ChartingSketch sketch) and now it works!! [/Edit]

    hack the planet

    modified on Sunday, September 13, 2009 4:28 AM

    H A 2 Replies Last reply
    0
    • G geali_dor

      Hey there, i am programming a charting Libary for my Financial Suit. Therefore my idea was to have a Panel that has Lists of all my shapes (Line, Pie, Bar etc.) Wenn i resize my Panel the whole shapes are flickering very much. i googled and codeprojected a few days but i got no satisfying answer.

      Control.SetStyle(ControlStyles.OptimizedDoubleBuffer, true)

      ...does unfortunately not work, because, when i set this style, the shapes only appeare frequently on resizing, but when the resizing is finished (MouseUp) the Panel is empty (white; and if i override the OnPaintBackgound and comment the base.OnPaintBackgound out it is black) Does anyone know about this problems or had the same? Do i need some more Styles etc? Do i have to override some methods or properties? [Edit] Hey there, i finally figured it out: the problem is, if i use Control.SetStyle(ControlStyles.OptimizedDoubleBuffer, true) and an object uses Control.CreateGraphics() it will only be painted while resizing and not when resizing is finished! Now i'm using public void Draw(Graphics g) instead of public void Draw(ChartingSketch sketch) and now it works!! [/Edit]

      hack the planet

      modified on Sunday, September 13, 2009 4:28 AM

      H Offline
      H Offline
      Henry Minute
      wrote on last edited by
      #2

      Without seeing at least some of your painting code, it is almost impossible to say. Post the relevant parts of your code (enclosed in PRE tags, please), so that people can try to help. There is no need to reply to this, just edit your original post. :)

      Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

      1 Reply Last reply
      0
      • G geali_dor

        Hey there, i am programming a charting Libary for my Financial Suit. Therefore my idea was to have a Panel that has Lists of all my shapes (Line, Pie, Bar etc.) Wenn i resize my Panel the whole shapes are flickering very much. i googled and codeprojected a few days but i got no satisfying answer.

        Control.SetStyle(ControlStyles.OptimizedDoubleBuffer, true)

        ...does unfortunately not work, because, when i set this style, the shapes only appeare frequently on resizing, but when the resizing is finished (MouseUp) the Panel is empty (white; and if i override the OnPaintBackgound and comment the base.OnPaintBackgound out it is black) Does anyone know about this problems or had the same? Do i need some more Styles etc? Do i have to override some methods or properties? [Edit] Hey there, i finally figured it out: the problem is, if i use Control.SetStyle(ControlStyles.OptimizedDoubleBuffer, true) and an object uses Control.CreateGraphics() it will only be painted while resizing and not when resizing is finished! Now i'm using public void Draw(Graphics g) instead of public void Draw(ChartingSketch sketch) and now it works!! [/Edit]

        hack the planet

        modified on Sunday, September 13, 2009 4:28 AM

        A Offline
        A Offline
        April Fans
        wrote on last edited by
        #3

        because drawing in memory’s speed is much slower than showing to screen. lead to Delay. iam so glad to see you override the 'OnPaintBackgound ', 1) but i think you should can set 'form's double buffer property' to 'true', 2) or use a 'bitmap' to simulate 'double buffer'.

        April Comm100 - Leading Live Chat Software Provider

        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