Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PaintPicture with AutoRedraw = True slows application

Status
Not open for further replies.

aaronino

Programmer
Aug 6, 2001
19
US
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!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top