help to decode the camera data from the PreviewCallback

All your problems with Audio, Video and Images.

help to decode the camera data from the PreviewCallback

Postby androiduser123 » Wed May 27, 2009 7:32 am

Could someone help me to decode the camera data from the
PreviewCallback? I need to capture each camera preview frames and process
the bitmaps obtained by decoding the frames before displaying.
androiduser123
Junior Developer
Junior Developer
 
Posts: 13
Joined: Tue May 12, 2009 7:20 am

Top

Postby WillyWontHe » Sat May 30, 2009 2:14 am

The byte[] data argument you get from the callback is the picture. You can save it as a bitmap by using a FileOutputStream's write method and you can preview it on the screen by using:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);
  2.  
  3. ImageView imageView = new ImageView(PhotographMe.this);
  4.  
  5. imageView.setImageBitmap(bitmap);
  6.  
  7. setContentView(imageView);
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


hth
WillyWontHe
Freshman
Freshman
 
Posts: 3
Joined: Mon Apr 27, 2009 7:17 am
Location: Berkeley

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 9 guests