Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How to use Transparency key in Splash Screen

How to use Transparency key in Splash Screen

Scheduled Pinned Locked Moved Visual Basic
csharphelptutorialcareer
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    Ovais Memon
    wrote on last edited by
    #1

    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

    J S T C 4 Replies Last reply
    0
    • O Ovais Memon

      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

      J Offline
      J Offline
      John M Bundy
      wrote on last edited by
      #2

      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/[^]

      1 Reply Last reply
      0
      • O Ovais Memon

        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

        S Offline
        S Offline
        Steven J Jowett
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • O Ovais Memon

          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

          T Offline
          T Offline
          The Man from U N C L E
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          • O Ovais Memon

            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

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups