Drawing speed when scrolling

  • Thread starter Thread starter Torbjorn Stavas
  • Start date Start date
T

Torbjorn Stavas

I really don't know where to start, but i'll try to get your attention
by a post here.

I got a panel with a lot of radiobuttons and labels. When scrolling
this panel (using the panel-in-a-panel trick), the drawing/updating
performance is really sucky on the display. Not that strange, since
there's a lot of controls that need to get re-painted.

One way of improving the drawing speed, would be to substitute the
panel with a bitmap representing the look of the entire panel, and let
this bitmap be the one that is being scrolled. When the user is done
scrolling, i'll switch back to the panel again, with the same x/y
position of the bitmap.

My problem is that i don't know how to create this bitmap. If anyone
got any suggestion, or could point me in the right direction, i would
really appreciate it.

//Regards, Torbjorn
 
I really don't know where to start, but i'll try to get your attention
by a post here.

I got a panel with a lot of radiobuttons and labels. When scrolling
this panel (using the panel-in-a-panel trick), the drawing/updating
performance is really sucky on the display. Not that strange, since
there's a lot of controls that need to get re-painted.

One way of improving the drawing speed, would be to substitute the
panel with a bitmap representing the look of the entire panel, and let
this bitmap be the one that is being scrolled. When the user is done
scrolling, i'll switch back to the panel again, with the same x/y
position of the bitmap.

My problem is that i don't know how to create this bitmap. If anyone
got any suggestion, or could point me in the right direction, i would
really appreciate it.

//Regards, Torbjorn

I need to clarify some things.

I don't mean a bitmap specifically, i just wanna create a graphics
object that has the same look as the panel.

The panel is not made at design time, but during runtime, and shows
data fetched from a database, so the look of the panel changes of
course.

Another question is when to create this graphics object. I'd like to
start a new thread when the panel is presented to the user, and create
the graphics of the "fake panel" in the background. I know that you're
not allowed to manipulate the gui in a thread different from the main
one, but is it ok to create a graphics object in a different thread?

//Regards, Torbjorn
 
Back
Top