Alex Rivera | Logout

Android create layers in canvas

Asked 2012-05-18T06:54:42.163
15

I want to learn how can I create layers (like in photoshop) in my android application. I want to achieve one basic thing: when I add an image in my canvas, which will be some figure for example, I want to be able to paint the canvas, but the painting must not effect the lines of figure. And then I need to save that image on my Sd card.

Any suggestions/advice/examples? What can I use to achieve this?

Edit
Report

1 Answer

0

You can compose your layers in a FrameLayout. You might need some trickery to ensure touch events get passed to the correct layer.

Once you have android composing your views how you like, you can mFrameLayout.onDraw(Canvas c) to draw the entire thing to a canvas.

This article has some info on how to turn your viewgroup into a jpeg Image on canvas to JPEG file

answered 2012-05-25T23:16:29.107

Your Answer