Refresh is so slow...

M

Marco Trapanese

Hello,

I'm using VB.NET Express 2008 under Windows XP. My user-control is
composed of a label and a picture box.

On the main form I placed some of that controls. The background color of
the label, of the picture box and of the form itself is transparent.
It's very nice to see because the main form has a bitmap on the background.

The downside is the looong time needed to redraw the form content. I'm
talking about 1-2 seconds, too much for the project requirements.

If I either disable the transparent backgrounds or remove the background
image it works fine.

Please note that:

* the bitmap is actually a jpg picture with its dimensions equal to the
form, so no scaling is required;

* both forms have the double buffer property enabled


What should I do to have a decent redraw time using bitmap and
transparencies?

Thank you
Marco
 
R

rowe_newsgroups

Hello,

I'm using VB.NET Express 2008 under Windows XP. My user-control is
composed of a label and a picture box.

On the main form I placed some of that controls. The background color of
the label, of the picture box and of the form itself is transparent.
It's very nice to see because the main form has a bitmap on the background.

The downside is the looong time needed to redraw the form content. I'm
talking about 1-2 seconds, too much for the project requirements.

If I either disable the transparent backgrounds or remove the background
image it works fine.

Please note that:

* the bitmap is actually a jpg picture with its dimensions equal to the
form, so no scaling is required;

* both forms have the double buffer property enabled

What should I do to have a decent redraw time using bitmap and
transparencies?

Thank you
Marco

I believe the best way to get these desired effects is to create the
form using WPF instead of a standard WinForms application. Be warned
that there is a significant "warm up" period to get comfortable with
WPF, but it is extremely powerful.

For example, I've actually seen a smooth running WPF example that had
seperate videos playing as the background for items in a drop down
list :)

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
 
R

rowe_newsgroups

I believe the best way to get these desired effects is to create the
form using WPF instead of a standard WinForms application. Be warned
that there is a significant "warm up" period to get comfortable with
WPF, but it is extremely powerful.

For example, I've actually seen a smooth running WPF example that had
seperate videos playing as the background for items in a drop down
list :)

Thanks,

Seth Rowe [MVP]http://sethrowe.blogspot.com/

I also should have mentioned that you can create a user control in WPF
and host just that usercontrol in a WinForms form. That may allow you
to get the desired functionality while avoiding a complete rewrite.

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
 
M

Marco Trapanese

rowe_newsgroups ha scritto:


In other words, transparencies in Windows Forms don't work ;)

I also should have mentioned that you can create a user control in WPF
and host just that usercontrol in a WinForms form. That may allow you
to get the desired functionality while avoiding a complete rewrite.


Great! I'll give it a try.

Thank you
Marco
 
M

Marco Trapanese

rowe_newsgroups ha scritto:
I also should have mentioned that you can create a user control in WPF
and host just that usercontrol in a WinForms form. That may allow you
to get the desired functionality while avoiding a complete rewrite.


I created the WPF user control and set its background as transparent. It
was ok, I saw the background image of the main (windows) form.

Then I added a label, set its background transparent too. Now, I see a
gray box... it's not transparent at all. I can change the colors but
when I select transparent it appears gray.

Any idea?


Thanks again
Marco
 

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

Similar Threads


Top