Flickering Problem [modified]
-
Hey there, i am programming a charting Libary for my Financial Suit. Therefore my idea was to have a
Panel
that hasList
s of all myshapes
(Line, Pie, Bar etc.) Wenn i resize myPanel
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
) thePanel
is empty (white; and if i override theOnPaintBackgound
and comment thebase.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 useControl.SetStyle(ControlStyles.OptimizedDoubleBuffer, true)
and an object usesControl.CreateGraphics()
it will only be painted while resizing and not when resizing is finished! Now i'm usingpublic void Draw(Graphics g)
instead ofpublic void Draw(ChartingSketch sketch)
and now it works!! [/Edit]hack the planet
modified on Sunday, September 13, 2009 4:28 AM
-
Hey there, i am programming a charting Libary for my Financial Suit. Therefore my idea was to have a
Panel
that hasList
s of all myshapes
(Line, Pie, Bar etc.) Wenn i resize myPanel
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
) thePanel
is empty (white; and if i override theOnPaintBackgound
and comment thebase.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 useControl.SetStyle(ControlStyles.OptimizedDoubleBuffer, true)
and an object usesControl.CreateGraphics()
it will only be painted while resizing and not when resizing is finished! Now i'm usingpublic void Draw(Graphics g)
instead ofpublic void Draw(ChartingSketch sketch)
and now it works!! [/Edit]hack the planet
modified on Sunday, September 13, 2009 4:28 AM
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.”
-
Hey there, i am programming a charting Libary for my Financial Suit. Therefore my idea was to have a
Panel
that hasList
s of all myshapes
(Line, Pie, Bar etc.) Wenn i resize myPanel
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
) thePanel
is empty (white; and if i override theOnPaintBackgound
and comment thebase.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 useControl.SetStyle(ControlStyles.OptimizedDoubleBuffer, true)
and an object usesControl.CreateGraphics()
it will only be painted while resizing and not when resizing is finished! Now i'm usingpublic void Draw(Graphics g)
instead ofpublic void Draw(ChartingSketch sketch)
and now it works!! [/Edit]hack the planet
modified on Sunday, September 13, 2009 4:28 AM
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