Re: Horizontal ScrollBar+ PictureBox + Flickering (how to stop flickering?)
- From: Frank Moyles <fgmoyles@xxxxxxxxxx>
- Date: Thu, 20 Dec 2007 19:04:10 +0000
Mike Williams wrote:
"Frank Moyles" <fgmoyles@xxxxxxxxxx> wrote in message news:wMydncOyocwrHvfaRVnyhAA@xxxxxxxxx
I have a PictureBox placed on a form, as well as a horizontal
scroll bar. I am drawing a graph (output from an instrument)
on the PictureBox. I am 'scrolling' the graph by dragging the
horizontal scroll bar. Each time the scroll bar changes, I am
getting the new values and using that event to redraw the
graph - it works in theory, but in practise, it flickers quite a lot.
Try drawing into a backbuffer first. One very easy way of doing this is to simply set the Autoredraw property of the PictureBox to True, which will eliminate the flicker. You might also like to try speeding up the drawing of your graph lines using the PolyLine API instead of drawing the individual lines one by one (if that is what you are currently doing).
Mike
Hi Mike, setting AutoRedraw property of the PictureBox to true has no effect - namely, 'scrolling the graph' still causes flickering.
Additionally, I am using third party graphics library so I cannot use teh PolyLine API as an alternative. Hmmm, this seems to leave me with only one alternative (drawing into a buffer).
On the face of it - I can't se how it will work, since I am repainting the graph on every scroll( for fine garnualrity) and change (coarser granularity) event - so I'm not sure how drawing to a back buffer might help - unless I'm missing something - e.g. draw a graph with a bigger window size and then 'slide' that window accross - even using this technique, there are likely to be times (at the edge of the 'window') when the graph may flicker as a new 'window is loaded - is this the approach you had in mind ?
.
- Follow-Ups:
- Re: Horizontal ScrollBar+ PictureBox + Flickering (how to stop flickering?)
- From: Mike Williams
- Re: Horizontal ScrollBar+ PictureBox + Flickering (how to stop flickering?)
- References:
- Horizontal ScrollBar+ PictureBox + Flickering (how to stop flickering?)
- From: Frank Moyles
- Re: Horizontal ScrollBar+ PictureBox + Flickering (how to stop flickering?)
- From: Mike Williams
- Horizontal ScrollBar+ PictureBox + Flickering (how to stop flickering?)
- Prev by Date: Re: Limitation of properties of usercontrol
- Next by Date: Re: Sourcesave, forgotten user name!
- Previous by thread: Re: Horizontal ScrollBar+ PictureBox + Flickering (how to stop flickering?)
- Next by thread: Re: Horizontal ScrollBar+ PictureBox + Flickering (how to stop flickering?)
- Index(es):
Relevant Pages
|
Loading