use of de.neemann.digital.draw.graphics.linemerger.GraphicSkipLines in project Digital by hneemann.
the class Export method export.
/**
* Export the file
*
* @param out stream to write the file to
* @throws IOException IOException
*/
public void export(OutputStream out) throws IOException {
try (Graphic gr = factory.create(out)) {
GraphicMinMax minMax = new GraphicMinMax(gr);
circuit.drawTo(minMax);
gr.setBoundingBox(minMax.getMin(), minMax.getMax());
GraphicLineCollector glc = new GraphicLineCollector();
circuit.drawTo(glc);
glc.drawTo(gr);
circuit.drawTo(new GraphicSkipLines(gr));
}
}
use of de.neemann.digital.draw.graphics.linemerger.GraphicSkipLines in project Digital by hneemann.
the class GifExporter method createBufferedImage.
private BufferedImage createBufferedImage() throws IOException {
GraphicsImage gri = new GraphicsImage(null, "gif", 1);
gri.setBoundingBox(minMax.getMin(), minMax.getMax());
BufferedImage bi = gri.getBufferedImage();
Graphics gr = bi.getGraphics();
gr.setColor(Color.WHITE);
gr.fillRect(0, 0, bi.getWidth(), bi.getHeight());
GraphicLineCollector glc = new GraphicLineCollector();
circuit.drawTo(glc);
glc.drawTo(gri);
circuit.drawTo(new GraphicSkipLines(gri));
return gri.getBufferedImage();
}
Aggregations