1

I have recently started using PlayN for a hobby project and has now stumbled upon a problem.

I would like to draw some lines and text onto an Image and save this image for later use. In Java I would just make a BufferedImage and use its graphicsBuffered to draw upon, but I can not find any similar solution in PlayN.

Is this at all possible, and if so how ?

I somehow need to be able to convert a BufferedImage to an Image and the other way around.

user1069703
  • 261
  • 1
  • 2
  • 10
  • Does the code in question+answer [on this question][1] help? [1]: http://stackoverflow.com/questions/8890321/programmatically-fading-in-an-image-in-playn – A T Jan 20 '12 at 09:21
  • Not exactly. I know how I can make an Image onto an ImageLayer allowing be to draw on the layer, but I want to create a permanently drawn Image "caching" the drawing operations. – user1069703 Jan 20 '12 at 10:37

1 Answers1

2

Create a CanvasImage, draw your image onto the CanvasImage, and then draw your text and lines on top of it. You can then use the CanvasImage in an ImageLayer to put it into your scene graph.

samskivert
  • 3,694
  • 20
  • 22