Painting a forms background
Posted on 1998-09-04
The time that it takes to paint a forms background is far to long. This is how I am doing it.
First I load the picture into a Picture Box control that is hidden on the form. Then using the height and width of the Picture Box I tile the forms background using the appropriate x and y coordinates. This works very well and is extremely fast especially if the picture is small.
My problem begins when I want to apply a picture that is 1024x768 to the form. Obviously there is no need to tile since the resolution I use is also 1024x768. But it seems like it takes forever to load the control with the picture and equally as long to paint the form. I have tried painting the form directly with the picture and not loading the Picture Box but while this takes half the time, it is still far to slow. By slow I mean 1 second up to as much as 5 seconds. The lag is barely noticeable on a P-II but since the typical platform this will be running on is a Pentium-200, I need to find a way to speed this up.
Any comments, questions or suggestions will greatly appreciated.