Changeset 31028 in osm for applications/editors/josm/plugins/seachart/jrender
- Timestamp:
- 2015-02-20T01:43:42+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/jrender/src/jrender/Jrender.java
r31027 r31028 12 12 import java.awt.Dimension; 13 13 import java.awt.Graphics2D; 14 import java.awt.Rectangle; 14 15 import java.awt.geom.Point2D; 15 16 import java.awt.image.BufferedImage; … … 209 210 } 210 211 211 /* img = new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB); 212 Renderer.reRender(img.createGraphics(), 12, 1, map, context); 212 // img = new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB); 213 Rectangle rect = new Rectangle(2048, 2048); 214 img = new BufferedImage(rect.width, rect.height, BufferedImage.TYPE_INT_ARGB); 215 Renderer.reRender(img.createGraphics(), rect, zoom, 0.05, map, context); 213 216 ByteArrayOutputStream bos = new ByteArrayOutputStream(); 214 217 ImageIO.write(img, "png", bos); 215 empty = bos.size(); 216 tile(zoom, 1, 0, 0); 217 */ 218 // empty = bos.size(); 219 // tile(zoom, 1, 0, 0); 220 FileOutputStream fos = new FileOutputStream(dstdir + "tst_" + zoom + ".png"); 221 bos.writeTo(fos); 222 fos.close(); 223 218 224 // for (int z = 12; z <= 18; z++) { 219 int z = 9;220 225 DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation(); 221 226 Document document = domImpl.createDocument("http://www.w3.org/2000/svg", "svg", null); 222 227 SVGGraphics2D svgGenerator = new SVGGraphics2D(document); 223 228 svgGenerator.setBackground(Rules.Bwater); 224 svgGenerator.clearRect( 0, 0, 2048, 2048);225 svgGenerator.setSVGCanvasSize( new Dimension(2048, 2048));226 svgGenerator.setClip( 0, 0, 2048, 2048);227 // svgGenerator.translate(-2 048, -2048);228 Renderer.reRender(svgGenerator, z, 0.05, map, context);229 svgGenerator.stream(dstdir + "tst_" + z + ".svg"); 229 svgGenerator.clearRect(rect.x, rect.y, rect.width, rect.height); 230 svgGenerator.setSVGCanvasSize(rect.getSize()); 231 svgGenerator.setClip(rect.x, rect.y, rect.width, rect.height); 232 // svgGenerator.translate(-256, -256); 233 Renderer.reRender(svgGenerator, rect, zoom, 0.05, map, context); 234 svgGenerator.stream(dstdir + "tst_" + zoom + ".svg"); 230 235 // } 231 236 } … … 239 244 g2.scale(s, s); 240 245 g2.translate(-(256 + (xn * 256 / s)), -(256 + (yn * 256 / s))); 241 Renderer.reRender(g2, zoom, 1, map, context); 246 Renderer.reRender(g2, new Rectangle(256, 256), zoom, 1, map, context); 242 247 ByteArrayOutputStream bos = new ByteArrayOutputStream(); 243 248 ImageIO.write(img, "png", bos);
Note:
See TracChangeset
for help on using the changeset viewer.