This seems so trivial, yet I cannot find where or how to do this.
i need to be able to create o开发者_开发问答n the fly blank png in a WPF project. Size of the png does not matter, I just need to be able to create one and save it on a specifiy path by pressing a button.
For some reason, I can't find it anywhere.
You can create a Bitmap
object and manipulate it as you need. The Bitmap
object has a Save
method that let's you specify what file format to save it as, one choice being Png.
http://msdn.microsoft.com/en-us/library/system.drawing.bitmap.aspx
try:
bm.Save(filename, Imaging.ImageFormat.Png);
精彩评论