mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-26 22:41:59 -04:00
better quality of animated gifs
This commit is contained in:
parent
29b9909118
commit
977f3d889d
@ -81,7 +81,7 @@
|
||||
</visualElements>
|
||||
<wires>
|
||||
<wire>
|
||||
<p1 x="480" y="80"/>
|
||||
<p1 x="460" y="80"/>
|
||||
<p2 x="580" y="80"/>
|
||||
</wire>
|
||||
<wire>
|
||||
@ -89,7 +89,7 @@
|
||||
<p2 x="580" y="160"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="460" y="340"/>
|
||||
<p1 x="480" y="340"/>
|
||||
<p2 x="540" y="340"/>
|
||||
</wire>
|
||||
<wire>
|
||||
@ -102,7 +102,7 @@
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="260"/>
|
||||
<p2 x="460" y="260"/>
|
||||
<p2 x="480" y="260"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="520" y="260"/>
|
||||
@ -130,7 +130,7 @@
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="420"/>
|
||||
<p2 x="480" y="420"/>
|
||||
<p2 x="460" y="420"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="520" y="420"/>
|
||||
@ -141,7 +141,7 @@
|
||||
<p2 x="680" y="420"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="460" y="120"/>
|
||||
<p1 x="480" y="120"/>
|
||||
<p2 x="580" y="120"/>
|
||||
</wire>
|
||||
<wire>
|
||||
@ -158,7 +158,7 @@
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="440" y="220"/>
|
||||
<p2 x="460" y="220"/>
|
||||
<p2 x="480" y="220"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="420" y="380"/>
|
||||
@ -193,8 +193,12 @@
|
||||
<p2 x="440" y="460"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="480" y="80"/>
|
||||
<p2 x="480" y="420"/>
|
||||
<p1 x="480" y="260"/>
|
||||
<p2 x="480" y="340"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="480" y="120"/>
|
||||
<p2 x="480" y="220"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="500" y="160"/>
|
||||
@ -261,12 +265,8 @@
|
||||
<p2 x="680" y="440"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="460" y="260"/>
|
||||
<p2 x="460" y="340"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="460" y="120"/>
|
||||
<p2 x="460" y="220"/>
|
||||
<p1 x="460" y="80"/>
|
||||
<p2 x="460" y="420"/>
|
||||
</wire>
|
||||
</wires>
|
||||
</circuit>
|
@ -12,6 +12,7 @@ import de.neemann.digital.draw.graphics.linemerger.GraphicSkipLines;
|
||||
|
||||
import javax.imageio.stream.FileImageOutputStream;
|
||||
import javax.imageio.stream.ImageOutputStream;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@ -69,14 +70,19 @@ public class GifExporter {
|
||||
|
||||
|
||||
private BufferedImage createBufferedImage() throws IOException {
|
||||
GraphicsImage gr = GraphicsImage.create(null, minMax.getMin(), minMax.getMax(), "gif", 2);
|
||||
GraphicsImage gri = GraphicsImage.create(null, minMax.getMin(), minMax.getMax(), "gif", 1);
|
||||
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(gr);
|
||||
glc.drawTo(gri);
|
||||
|
||||
circuit.drawTo(new GraphicSkipLines(gr));
|
||||
circuit.drawTo(new GraphicSkipLines(gri));
|
||||
|
||||
return gr.getBufferedImage();
|
||||
return gri.getBufferedImage();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user