I’m trying to generate a PNG file using C#. Everything I google seems to be WPF related. My issue is, I need to create a PNG 50×50 square filled with green in .NET 2.0.
My question is, how do I do this? I was looking in the System.Drawing namespace. But after all of that, I feel I’m way off. Can someone give me some pointers?
You can create a bitmap with the size you want, then create a
Graphicsobject to be able to draw on the bitmap. TheClearmethod is the simplest way to fill the image with a color. Then save the image using the PNG format: