Hello,
I'm writing an application that simulates a Windows desktop. The user selects a background and that background image is painted to a form -- the image is either stretched to fit the screen or centered on the screen. I use the PaintPicture method to put the image on the form.
Unfortunately, the application is dramatically slowed down once the image is painted (if AutoRedraw is set to true). I haven't tried manually redrawing the form when its necessary because I don't know how, but that may be a possibility -- there are few events that will cause the form to need to be redrawn, I think. It is, however, necessary to be able to redraw the form or simulate a redraw.
If I use the form's Picture property then there aren't any speed problems, but you don't have the option to set the image dimensions (to stretch the image, or place it in the center of the form).
If anyone has any ideas as to how this could be done better or even why this is happening, I would appreciate the help.
Thanks in advance!
I'm writing an application that simulates a Windows desktop. The user selects a background and that background image is painted to a form -- the image is either stretched to fit the screen or centered on the screen. I use the PaintPicture method to put the image on the form.
Unfortunately, the application is dramatically slowed down once the image is painted (if AutoRedraw is set to true). I haven't tried manually redrawing the form when its necessary because I don't know how, but that may be a possibility -- there are few events that will cause the form to need to be redrawn, I think. It is, however, necessary to be able to redraw the form or simulate a redraw.
If I use the form's Picture property then there aren't any speed problems, but you don't have the option to set the image dimensions (to stretch the image, or place it in the center of the form).
If anyone has any ideas as to how this could be done better or even why this is happening, I would appreciate the help.
Thanks in advance!