Tag Archives: transparent

Make a tool that creates PNG files with transparent backgrounds in C#

When you use the File menu’s Open command, the following code lets you select a image file. // The image. private Bitmap Bm = null; // Offset for displaying the image. private const int Offset = 10; // Open a … Continue reading

Posted in graphics, image processing | Tagged , , , , , , , , , , , , , | Leave a comment

Give an image a transparent background in C#

The Bitmap class’s MakeTransparent method changes all of the pixels with a given color to the transparent color A = 0, R = 0, G = 0, B = 0. When the program starts, the following code makes the background … Continue reading

Posted in graphics, image processing | Tagged , , , , , , , , , , , , | Leave a comment

Adjust image translucency in C#

The example Use an ImageAttributes object to adjust an image’s brightness in C# uses a ColorMatrix object to scale the red, green, and blue color components of an image’s pixels. You can use a similar technique to scale the pixels’ … Continue reading

Posted in drawing, graphics, image processing | Tagged , , , , , , , , , , , , , , , , | Leave a comment

Make a Region from non-transparent pixels in C#

The example Make shaped PictureBoxes in C# sets the Region property of two PictureBox controls to circular regions. That works well in that example where the images are round volleyballs with transparent backgrounds, but it would be hard to manually … Continue reading

Posted in algorithms, geometry, graphics, image processing | Tagged , , , , , , , , , , , , , | Leave a comment

Remove part of an image in C#

This example lets you remove part of an image. It lets you load an image file and then click and drag to select an area on the image. When you release the mouse, the program generates two new images: an … Continue reading

Posted in algorithms, geometry, graphics, mathematics | Tagged , , , , , , , , , , , , | Leave a comment