public override void ToPng(string fileName) { if (!converted) { if (BitCount < 0x09) SetPaletteFromTmx(); else palData = new byte[] { }; SetDataFromTmx(); converted = true; tmxBr.Close(); rawMs.Close(); png = new PngClass(this); } png.Save(fileName); }
public static new TmxClass FromPng(string fileName) { PngClass png; TmxClass tmx; sio.FileInfo fi; fi = new sio.FileInfo(fileName); if (!fi.Exists) throw new sio.FileNotFoundException(string.Format("File '{0}' not found", fi.FullName)); png = new PngClass(fileName, (RawImgClass)new TmxClass()); tmx = (TmxClass)png.p3img; tmx.converted = false; return tmx; }