Reputation: 87
I think I'll need a buffered Image and to use a ImageOutputStream. Sorry I'm clueless, hence the lack of info here. I'm hoping for a solve-all magic method.
Upvotes: 1
Views: 2924
Reputation: 168845
See ImageIO.write(RenderedImage,String,ImageOutputStream)
.
Upvotes: -1
Reputation: 35096
Canvas to BufferedImage:
Canvas c = ...
BufferedImage im = ...
Graphics g = im.getGraphics();
c.paint(g);
BufferedImage to Canvas: in paint(Graphics g) method call:
g.drawImage(im, 0, 0, null);
Upvotes: 1