| Conditions | 2 |
| Total Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | package org.gannacademy.cdf.turtlelogo.docs; |
||
| 16 | public void drawTo(String path, String format) { |
||
| 17 | try { |
||
| 18 | BufferedImage image = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_ARGB); |
||
| 19 | Graphics2D context = image.createGraphics(); |
||
| 20 | context.setPaint(getBackground()); |
||
| 21 | context.fillRect(0, 0, image.getWidth(), image.getHeight()); |
||
| 22 | draw(context); |
||
| 23 | ImageIO.write(image, format, new File(path)); |
||
| 24 | } catch (IOException e) { |
||
| 25 | e.printStackTrace(); |
||
|
|
|||
| 26 | } |
||
| 29 |