.Net & C #: trying to get a transparent image on a button (assigned from the IDE)

Using VS2005 and C #.

Having a button in the form and an image from the resource, the image does not have transparency.

How can I get transparency when assigning an image from the IDE?

Thanks.

+3
source share
2 answers

Open the image in an image editor (Paint.NET and GIMP are free) and add transparencies wherever you need.

Everything will work as soon as the image has transparent pixels.

You can also use several methods of the Bitmap class to do this:

Bitmap b = Properties.Resources.MyImage;
b.MakeTransparent(b.GetPixel(0, 0));
+3
source

, . , , , - .png.

: , , , , ? , , , . Paint.Net - .

0

Source: https://habr.com/ru/post/1704687/


All Articles