public void Image_Write() { var tmp = GetNewFileNameOnTempPath("png"); using (var bmp = new Bitmap(Path.Combine(TestDirectory, @"core\files\images\testImage.png"))) { Image.WriteToFile(tmp, bmp); using (var newBmp = new Bitmap(tmp)) { Assert.AreEqual(Image.Pixels(bmp), Image.Pixels(newBmp)); } } }
public static bool WriteImage(string filePath, string fileName, Bitmap image) { fileName = Path.ChangeExtension(fileName, "png"); Image.WriteToFile(Path.Combine(filePath, fileName), image); return(true); }