public virtual void imageUpdate(int x, int y, int w, int h, Color[] data, float[] alpha) { if (writer == null) { return; } try { writer.writeTile(x, y, w, h, data, alpha); } catch (IOException e) { UI.printError(UI.Module.IMG, "I/O error occured while writing image tile [({0},{1}) {2}{3}] image for display: {4}", x, y, w, h, 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); } }