Background images for windows forms

levyuk

Well-known member
Joined
Jun 7, 2004
Messages
313
Location
Wales, UK
Programming Experience
3-5
Does anyone know whymy application uses so much cpu time when I put an image as the background? The image is only 76k in size. Any idea on how I could reduce the cpu time used?

Thanks
Jon
 

Paszt

Staff member
Joined
Jun 3, 2004
Messages
1,500
Location
Raleigh, NC - USA
Programming Experience
Beginner
Are you simple setting the BackGroundImage property of the form to an image or are you using GDI+ to draw it?
 

TPM

Well-known member
Joined
Dec 7, 2004
Messages
623
Location
CA
Programming Experience
3-5
When you say CPU time do you mean usage? (as in the graph in task manager)
When is this 'CPU time' happening? i.e. on load up, all the time, when you do something....
Also are you sure the image is causeing the problem?

TPM
 

levyuk

Well-known member
Joined
Jun 7, 2004
Messages
313
Location
Wales, UK
Programming Experience
3-5
By CPU time I mean usage in task manager. It happens on form_load and whenever i move the form around the screen. I'm sure the image is the the problem because when i remove the image it works normally
 

TPM

Well-known member
Joined
Dec 7, 2004
Messages
623
Location
CA
Programming Experience
3-5
I think you'll find that you'll always get a spike at the start of you app. since JIT is compiling your code and everything is loading. The reason for the usage when moving around the screen is all the repaints. Unless it's effecting the operation of your app. I wouldn't worry about it.

TPM
 
Top Bottom