How to SAVE Pic

All your problems with Audio, Video and Images.

How to SAVE Pic

Postby doubleslash » Fri Mar 06, 2009 8:09 pm

Hi,
I want to save a picture taken by the camera. In my surfaceView which shows the camera preview, I have onPictureTaken implemented as follows
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. @Override
  2.  
  3.                 public void onPictureTaken(byte[] data, Camera camera) {
  4.  
  5.                         // TODO Auto-generated method stub
  6.  
  7.                          Bitmap bmp = BitmapFactory.decodeByteArray(data, 0, data.length);
  8.  
  9.                         MediaStore.Images.Media.insertImage(context.getContentResolver(), bmp, "pic", "pic");
  10.  
  11. }
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
This throws some kind of exception, not sure how to get a handle on that. Then, I wrote a separate app just to save a bitmap using the same MediaStore syntax. After running the app, I open the Pictures folder on the device, and get the message that goes like Camera class has been terminated. I can find the pic after restarting my phone though. From searching here and the google discussion groups, I got the impression that saving a pic is a big can of worms. But there's got to be a way to do it. The native camera app can do it. Can someone help please?
Thanks
doubleslash
Developer
Developer
 
Posts: 30
Joined: Fri Feb 13, 2009 6:05 am

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 9 guests