J
jgraham
I have an application which configures the user interface (UI) at
runtime, meaning, the images that make up the UI are loaded based on
the current configuration when the application starts. The UI is
populated with normal controls (buttons, lists, etc.) but some controls
can load a bitmap to represent them. For instance, each button in the
window loads a bitmap as it's BackgroundImage. Also, the
BackgroundImage of each dialog is also specified so as to embed an
image as the background for the dialog. I am loading the bitmaps at
startup as follows:
this.BackgroundImage = new Bitmap(imagefile); // a
System.Windows.Forms.Form
or
this.mybutton.BackgroundImage = new Bitmap(imagefile); // a button
My problem comes when the screen is refreshed. For instance, when I
open a new dialog and then close it and return to the main window, the
main window refreshes very slowly. I am not overriding the Paint
method in the main window. The machine is also not underpowered as it
is a 3.2Ghz with 2GB of memory. The images themselves are either BMP
or GIF files and they are not large (e.g. my 800x600 window background
image is 1,407KB in BMP format and 21KB in GIF). Each window only
contains a few (~10) controls and the typical button file size is
around 3KB for the GIF files. The images are also not reloaded each
time a new dialog is opened; they are loaded only at startup.
Can someone help me improve the refresh performance under these
circumstances?
Thanks!
runtime, meaning, the images that make up the UI are loaded based on
the current configuration when the application starts. The UI is
populated with normal controls (buttons, lists, etc.) but some controls
can load a bitmap to represent them. For instance, each button in the
window loads a bitmap as it's BackgroundImage. Also, the
BackgroundImage of each dialog is also specified so as to embed an
image as the background for the dialog. I am loading the bitmaps at
startup as follows:
this.BackgroundImage = new Bitmap(imagefile); // a
System.Windows.Forms.Form
or
this.mybutton.BackgroundImage = new Bitmap(imagefile); // a button
My problem comes when the screen is refreshed. For instance, when I
open a new dialog and then close it and return to the main window, the
main window refreshes very slowly. I am not overriding the Paint
method in the main window. The machine is also not underpowered as it
is a 3.2Ghz with 2GB of memory. The images themselves are either BMP
or GIF files and they are not large (e.g. my 800x600 window background
image is 1,407KB in BMP format and 21KB in GIF). Each window only
contains a few (~10) controls and the typical button file size is
around 3KB for the GIF files. The images are also not reloaded each
time a new dialog is opened; they are loaded only at startup.
Can someone help me improve the refresh performance under these
circumstances?
Thanks!