Swizzbeat Posted June 4, 2014 Share Posted June 4, 2014 Create image -> draw shapes or whatever on it -> save image with those graphic modifications That's what I'd like to do. nevermind got it lol if anyone wants to clue me in on how to grab script paint in the onExit method before the bot itself clears it that would be great 1 Link to comment Share on other sites More sharing options...
PolishCivil Posted June 4, 2014 Share Posted June 4, 2014 v2? Sth like @Override public void onExit() throws InterruptedException { System.out.println("Exit"); try { takeScreenshoot(); } catch (IOException e) { e.printStackTrace(); } super.onExit(); } private void takeScreenshoot() throws IOException { BufferedImage screenshoot = new BufferedImage(this.bot.getCanvas().getWidth(), this.getBot().getCanvas().getHeight(), BufferedImage.TYPE_INT_ARGB); Graphics2D graphics2D = screenshoot.createGraphics(); final BufferedImage gameBuffer = this.bot.getCanvas().gameBuffer; graphics2D.drawImage(gameBuffer, 0, 0, null); this.onPaint(graphics2D); ImageIO.write(screenshoot, "png", new File("screenshot" + new Date(System.currentTimeMillis()).toString().replace(':', '-') + ".png")); } 1 Link to comment Share on other sites More sharing options...
Swizzbeat Posted June 4, 2014 Author Share Posted June 4, 2014 (edited) v2? Sth like public class ProgressReport { private Image image; private ProgressReport(Image image) { this.image = image; } public static ProgressReport getReport(Script sI) throws AWTException { Canvas c = sI.bot.getCanvas(); return new ProgressReport(new Robot().createScreenCapture(new Rectangle(c.getX(), c.getY(), c.getWidth(), c.getHeight()))); } public boolean save(String filename) throws IOException { Graphics imageGraphics = image.getGraphics(); imageGraphics.setColor(Color.BLACK); imageGraphics.fillRect(7, 458, 71, 15); return ImageIO.write((BufferedImage) image, "png", new File(filename + ".png")); } } That's what I have however my issue is that I can't seem to grab the canvas with the script paint on it before the script exits From what you can see above I tried using Toolkit as well but even that doesn't get the paint. Also, what is the original gameBuffer representing? Edited June 4, 2014 by Swizzbeat Link to comment Share on other sites More sharing options...