Re: Transparency in picturebox Layers ? How to? See Here....

  • 14 years ago

    I have been wondering around a lot of classes and at last i discovered that Visual Studion itself supports transparency just have a look on the following  piece of code.

     

    Image

    topImage = (Bitmap)bmpImage;     //image which is to be made transparent

    Bitmap topBitmap = new Bitmap(topImage);

    topBitmap.MakeTransparent(clrTransparent);  // clrTransparent -> Color that you want to be transparent can be  anything white...Grey -- Balck or any other colors.

    With this code you can change the image (bmpimage) to any formats bmp,jpg,png,gif etc and all of these supports

    transparency

    But before continuing set the background color of the picture as transparent (VS feature)

    Have fun

    Sachit

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook