black screen on G1 when displaying a bitmap to a canvas

Put your problem here if it does not fit any of the other categories.

black screen on G1 when displaying a bitmap to a canvas

Postby androiduser123 » Sat May 16, 2009 7:27 am

I need to display a picture taken by camera on surfaceview.

I converted byte array to bitmap in method onPictureTaken(byte[] data, Camera camera) of Camera.PictureCallback.


Camera.PictureCallback cb = new Camera.PictureCallback() {
public void onPictureTaken(byte[] data, Camera camera) {

camera.startPreview();
Bitmap b= BitmapFactory.decodeByteArray(data, 0, data.length, null);

}
};

I then tried to draw this bitmap on a surfaceview
Canvas canvas = holder.lockCanvas();

Rect bounds=new Rect(0, 0, 320,240);
Paint paint = new Paint();
paint.setColor(0xFF0000FF);

canvas.drawBitmap(b, null, bounds, paint);

holder.unlockCanvasAndPost(canvas);

It is running well on emulator but when run on G1 device , it displays a black screen.

Please help me, if anyone knows the answer
androiduser123
Junior Developer
Junior Developer
 
Posts: 13
Joined: Tue May 12, 2009 7:20 am

Top

Postby androiduser123 » Sat May 16, 2009 12:08 pm

Please help..I m still not able to do it :(
androiduser123
Junior Developer
Junior Developer
 
Posts: 13
Joined: Tue May 12, 2009 7:20 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Alexa [Bot], Yahoo [Bot] and 22 guests