From: Hendrik B. <nh...@us...> - 2011-07-31 06:22:29
|
Update of /cvsroot/arianne/unrelated-stuff/src/net/sf/arianne/tools/image In directory vz-cvs-4.sog:/tmp/cvs-serv11280/src/net/sf/arianne/tools/image Modified Files: ImageSplit.java Log Message: fixed off by one error Index: ImageSplit.java =================================================================== RCS file: /cvsroot/arianne/unrelated-stuff/src/net/sf/arianne/tools/image/ImageSplit.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ImageSplit.java 31 Jul 2011 05:43:55 -0000 1.1 --- ImageSplit.java 31 Jul 2011 06:22:27 -0000 1.2 *************** *** 55,60 **** BufferedImage target = new BufferedImage(size, size, BufferedImage.TYPE_INT_RGB); Graphics2D graphics = target.createGraphics(); ! graphics.drawImage(img, 0, 0, size - 1, size - 1, x * size, y * size, (x+1) * size - 1, (y+1) * size - 1, new Color(0, 0, 0), null); ! OutputStream out = new FileOutputStream(targetFolder + "/" + prefix + x + "_0.png"); ImageIO.write(target, "png", out); out.close(); --- 55,60 ---- BufferedImage target = new BufferedImage(size, size, BufferedImage.TYPE_INT_RGB); Graphics2D graphics = target.createGraphics(); ! graphics.drawImage(img, 0, 0, size, size, x * size, y * size, (x+1) * size, (y+1) * size, new Color(0, 0, 0), null); ! OutputStream out = new FileOutputStream(targetFolder + "/" + prefix + x + "-" + y + ".png"); ImageIO.write(target, "png", out); out.close(); *************** *** 65,69 **** public static void main(String[] args) throws IOException { ! new ImageSplit("/tmp/world.png", "/tmp/map", "3_", 256).split(); } } --- 65,69 ---- public static void main(String[] args) throws IOException { ! new ImageSplit("/tmp/world.png", "/tmp/map", "5-", 256).split(); } } |