Slow draw speeds

G

Guest

Hi all;

I have a windows desktop application in which I have set as a background
image, a graphic that I whipped up. Its nothing fancey, just some gradient
colors, shadows, glow, that sort of stuff. I have tried different formats,
jpg, png, gif, bmp, and with every one, when the application starts, and when
I focus to a different window, then come back to the main one, it seems to
redraw the screen slowly. Each control will flash on the screen, total time
is maybe 1 second as all the controls flash. If I put regular system colors
back in, there is no issue. Is there anything I can do to speed this up? the
graphic files are not that big, 9 KB for the jpg image, 6 for the GIF. The
BMP is large, but it doesnt seem to make a difference which one I use, the
results are the same.

Thanks

I should note that the backgrounds are set on group boxes, and on a few
buttons.
 
N

Nicholas Paldino [.NET/C# MVP]

Rahvyn,

How are you drawing the background image? Are you loading the image in
each call to OnPaint, or have you loaded the image previously? Are you
double-buffering as well when drawing the image? These are the two things I
would look at first.
 
G

Guest

I actually set the background during design. I am not using the OnPaint
event at all, nor doing anything with the image during runtime. It looks
like each control has to redraw itself everytime the window is uncovered,
meaning when I put a window in front of it, and then pull the main one up
again.

Nicholas Paldino said:
Rahvyn,

How are you drawing the background image? Are you loading the image in
each call to OnPaint, or have you loaded the image previously? Are you
double-buffering as well when drawing the image? These are the two things I
would look at first.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Rahvyn said:
Hi all;

I have a windows desktop application in which I have set as a background
image, a graphic that I whipped up. Its nothing fancey, just some gradient
colors, shadows, glow, that sort of stuff. I have tried different formats,
jpg, png, gif, bmp, and with every one, when the application starts, and
when
I focus to a different window, then come back to the main one, it seems to
redraw the screen slowly. Each control will flash on the screen, total
time
is maybe 1 second as all the controls flash. If I put regular system
colors
back in, there is no issue. Is there anything I can do to speed this up?
the
graphic files are not that big, 9 KB for the jpg image, 6 for the GIF. The
BMP is large, but it doesnt seem to make a difference which one I use, the
results are the same.

Thanks

I should note that the backgrounds are set on group boxes, and on a few
buttons.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top