Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Saving image from SurfaceView

 
Manny Hernandez
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've exhausted all gooogle-search efforts on looking
for a solution for this one. I'm currently developing
an app that draws on the screen as you drag your
fingers. I've done this successfully with a SurfaceView
but the project requires it to be saved to a file.

However, when I do try to save the image, it only
saves a black screen(which is usually the issue
when people try to do this).

Apparently you can do this using a View, and I've
somehow managed a work-around to do this. The
problem is with my solution, the application runs
to a crawl. So using the View is not acceptable.

Please help.

P.S.
I would include code, but I've made so much changes
to it that all remnants of the one with a SurfaceView
is gone. (I'll try to rewrite it again if I have to for
a solution for this)

Thanks.
 
Przemek Boryka
Ranch Hand
Posts: 51
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi !

Take a look at this : Saving View to Bitmap, maybe this will help you.

Regards Przemek
 
Manny Hernandez
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would it be as fast as SurfaceView?
 
Przemek Boryka
Ranch Hand
Posts: 51
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi !

The SurfaceView is faster then View, but slower then the OpenGL library . Take a look at this :

2D Graphics Android

then look at this --> OpenGL

And answer yourself on your question

Bye. Greetings from Poland
 
Manny Hernandez
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the suggestions, but... I still fail to see how this would
help the problem: saving from SurfaceView.

Hmm... It could be that I just made a bad decision for my solution
for view. So I'll probably create a new thread for that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic