Getting started with Camera Preview and general 2D drawing

All your problems with Audio, Video and Images.

Getting started with Camera Preview and general 2D drawing

Postby pure » Sun Dec 07, 2008 4:40 pm


I have been reading and looking at some tutorials on how to get started with 2D drawing and also using the Camera preview. I this correct:

* In my view (extends SurfaceView) i have to create a Bitmap as an off screen image.

* I create an off screen canvas on which i can draw to

* On android.hardware.Camera.PreviewCallback.onPreviewFrame(byte[] data, Camera camera) i draw the data on to the offscreen bitmap but i will need to convert it first because there is a bug that gives native camera data ( ... 3ddc8abf9b)

* On the views onDraw something method i draw the bitmap on to the canvas of my view.

What i would like to have is an application that will show a preview of the camera and draw an overlay image on it. I would also like to be able to just draw part of the preview image on parts of the screen. So for example the top third of the preview on the top third of the screen.

Are there any examples of using PreviewCallback.onPreviewFrame?

Posts: 4
Joined: Sun Dec 07, 2008 4:25 pm


Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 6 guests