Write an image to the specified output stream in the specified format.
Supported formats include at least "gif" and "png", standard image file formats.
The image is a rendition of the current view of the model.
stream - The output stream to write to.
format - The image format to generate.
java.io.IOException - If writing to the stream fails.
java.awt.print.PrinterException - If the specified format is not supported.