public virtual void imageEnd() { if (writer == null) { return; } try { writer.closeFile(); } catch (IOException e) { UI.printError(UI.Module.IMG, "I/O error occured while closing the display: {0}", e.Message); } }
public void save(string filename) { string extension = FileUtils.getExtension(filename); BitmapWriter writer = PluginRegistry.bitmapWriterPlugins.createObject(extension); if (writer == null) { UI.printError(UI.Module.IMG, "Unable to save file \"{0}\" - unknown file format: {1}", filename, extension); return; } try { writer.openFile(filename); writer.writeHeader(w, h, Math.Max(w, h)); writer.writeTile(0, 0, w, h, color, alpha); writer.closeFile(); } catch (IOException e) { UI.printError(UI.Module.IMG, "Unable to save file \"{0}\" - {1}", filename, e.Message); } }