How to use Transparency key in Splash Screen
-
Dear All, I have designed a JPG file and want to use in splash screen in my vb.net project. I have set this image in form's background image property. In this JPG file, the blank space is filled with white background by default. But I dont need to show this white background in splash screen. Someone told me that there is a way to do this job by using transparency key. I tried alot by setting form's transparency key to white and also form's back color to white, but it doesn't work. Can anyone help me... Thanks Ovais
-
Dear All, I have designed a JPG file and want to use in splash screen in my vb.net project. I have set this image in form's background image property. In this JPG file, the blank space is filled with white background by default. But I dont need to show this white background in splash screen. Someone told me that there is a way to do this job by using transparency key. I tried alot by setting form's transparency key to white and also form's back color to white, but it doesn't work. Can anyone help me... Thanks Ovais
The transparency key likely wont work for your image as the white is made of of several different shades of many colors. You probably would be best to just remove the white background from the jpg.Add an Alpha Channel to your image and clear out the white, if you don't have (or know you have) a program to do this, here are some instructions for doing it in GIMP which is a free editor. http://weisbeek.freewebhostx.com/gimp/[^]
-
Dear All, I have designed a JPG file and want to use in splash screen in my vb.net project. I have set this image in form's background image property. In this JPG file, the blank space is filled with white background by default. But I dont need to show this white background in splash screen. Someone told me that there is a way to do this job by using transparency key. I tried alot by setting form's transparency key to white and also form's back color to white, but it doesn't work. Can anyone help me... Thanks Ovais
I'm not sure I'm right but JPEGs don't support transparency therefore try converting it to a PNG or GIF image and set the transparent colour in the colour pallet of the image. Then set the image file as the background of the splash form and set the splash form transparency to the back color of the form.
Steve Jowett ------------------------- Real programmers don't comment their code. If it was hard to write, it should be hard to read.
-
Dear All, I have designed a JPG file and want to use in splash screen in my vb.net project. I have set this image in form's background image property. In this JPG file, the blank space is filled with white background by default. But I dont need to show this white background in splash screen. Someone told me that there is a way to do this job by using transparency key. I tried alot by setting form's transparency key to white and also form's back color to white, but it doesn't work. Can anyone help me... Thanks Ovais
The image itself must support transparency, as has been said, you will have to save your image as a png or similar that supports transparency then make sure the transparent parts of the image really are transparent. After that set the form transparency key and backColor to the same colour. I usually use Fuschia as it is to vile a colour to be used for real and instantly shows up if you made a mistake. For more info on splash screens try any of the many articles here on code project eg. Creating a Splash Screen that runs without a message pump[^].
If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) www.JacksonSoft.co.uk
-
Dear All, I have designed a JPG file and want to use in splash screen in my vb.net project. I have set this image in form's background image property. In this JPG file, the blank space is filled with white background by default. But I dont need to show this white background in splash screen. Someone told me that there is a way to do this job by using transparency key. I tried alot by setting form's transparency key to white and also form's back color to white, but it doesn't work. Can anyone help me... Thanks Ovais
You can theoretically draw the image with transparency because you can use the ImageAttributes class to draw an image with a color range that is transparent. As others have said, JPEG is a lossy format, and your area of pure white will be turned in to blocks of various similar shades of white by the algorithm, that's why a range of whites would be needed. As was also said, PNG supports an alpha channel, which means .NET can just draw it with a transparent area.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.