PictureBox Transparency with GIF doesn't work on the fly

S

Sowen Zhang

Hi,

I am having a gif animation, when I place a picture box on the form, and
load the gif to it.

The transparency works fine.

But if I create a picturebox on the fly, and load the gif to it, the
transparency doesn't work. Even I set the backcolor to transparent, that
didn't help.

Any clue? Thanks a lot!



--
Best Regards!
Hong.
---------------------------
Image Processing and Watermark components for .NET
http://www.ImageComponent.NET

Personal Entertainment Shareware and Freeware
http://www.angGoGo.com
 
H

Herfried K. Wagner [MVP]

Sowen Zhang said:
I am having a gif animation, when I place a picture box on the form, and
load the gif to it.

The transparency works fine.

But if I create a picturebox on the fly, and load the gif to it, the
transparency doesn't work. Even I set the backcolor to transparent, that
didn't help.

I suggest to post the code you are using to load the GIF file and create the
picturebox control.
 
S

Sowen Zhang

Hi,

Thanks for your reply.

But truely, those are really simple code. Just create a new instance, then
load an image file, and add to the control collection.

If the background is a color, then even I create a picture on the fly, the
transparency still works.
If the background is another image, then it doesn't work.
If I load a background image to the form, then place a picture box with an
image, the transparency works fine.

Is this a bug of PictureBox?


Best Regards!
Hong.
 

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