wood burning stoves 2.0*
The moose likes Android and the fly likes How to save a Path & Paint object to file. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "How to save a Path & Paint object to file." Watch "How to save a Path & Paint object to file." New topic

How to save a Path & Paint object to file.

tien lq

Joined: Dec 31, 2010
Posts: 1
Hi everyone,

Now I'm using canvas.drawPath(Path path, Paint paint) to draw a path
which is created by user with a specified paint.
And before closing this app ( like PhotoShop app), I want to save this
Path and Paint. For the next time. So, user can start at their
previous canvas(screen).

Some said that they should be converted to bytearray [] and use
FileOutputStream to write it to file.
But I don't know how to do that.

Please, help me. I really really need your advice.
Thanks so much.
Peter Johnson

Joined: May 14, 2008
Posts: 5812

Assuming that you created a bitmap for the canvas to draw into, you could use the Bitmap.compress() method to write the bitmap to a file.


JBoss In Action
I agree. Here's the link: http://aspose.com/file-tools
subject: How to save a Path & Paint object to file.
Similar Threads
IE 5.5 and 6.0 - Saving Images - BMP only
Selecting a directory instead a file
Alternative to MS Paint
problem in unzipping
Using Properties File to set database path