The form refresh so slow
-
I use one image as the background picture. But when open the form, it shows so slow. How to solve it ?
-
I use one image as the background picture. But when open the form, it shows so slow. How to solve it ?
-
What are the things you are doing when the form is loading? Is it possible to move some of that to another thread? You can also use a splash screen and display the form only when all the operations are done.
Only initialize 20 controls, in which a circle is drawed. I try to delete background image, the form shows more quickly. So , it must the background image's problem. I am trying your solution, thanks very much.
-
Only initialize 20 controls, in which a circle is drawed. I try to delete background image, the form shows more quickly. So , it must the background image's problem. I am trying your solution, thanks very much.
I wonder if you are shrinking the image to fit, or should I say, .Net is shrinking it to fit. Check the actual size of the image and resize it to no larger than your form. You could also try some of the tricks from the html world, for example if you are aiming for a gradient fill, use a 1 pixel wide image and stretch it.
If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) [My Articles] [My Website]
-
Only initialize 20 controls, in which a circle is drawed. I try to delete background image, the form shows more quickly. So , it must the background image's problem. I am trying your solution, thanks very much.
-
I wonder if you are shrinking the image to fit, or should I say, .Net is shrinking it to fit. Check the actual size of the image and resize it to no larger than your form. You could also try some of the tricks from the html world, for example if you are aiming for a gradient fill, use a 1 pixel wide image and stretch it.
If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) [My Articles] [My Website]
Thanks for your reply. I donot shrink this image. but I only set the image as the background image of the form, perhaps this form's size is not equals to this image's size, when OnPaint it need use much time to let the image size to fix the form's size? I put many control in the forms, such as panle. I set these control's backcolor as transparent. Does the backcolor's transparent cost much time?
-
20 controls should not slow things drastically down. As the other reply mentions, check the image size and resize it to your needs. The type of file also matters. A bitmap file will be of a way more size (Bytes) than a same sized (dimension) JPG or JPEG.
The image is about 30kB in JPEG format, I will try to minish its size.