I am trying to display a Bitmap from the PictureCallback.
It works on the emulator but I get a blank screen on the G1.
In both cases I am running from Eclipse using ADT plugin.

Here is the relevant code:

public void onPictureTaken(byte[] data, Camera camera) {
        Bitmap bitmap = BitmapFactory.decodeByteArray(
                data, 0, data.length);
        Rect src = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight
());
        Canvas canvas = preview.getHolder().lockCanvas();
        Rect dst = new Rect(0, 0, canvas.getWidth(), canvas.getHeight
());
        canvas.drawBitmap(bitmap, src, dst, null);
        preview.getHolder().unlockCanvasAndPost(canvas);
}

preview is of class Preview extends SurfaceView implements
SurfaceHolder.Callback

Any clues appreciated.
Thanks!
Shawn

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to