views:

12

answers:

0

So far I have tried using a canvas, to make this canvas I have tried using these methods

//to create a canvas
mCanvas = mSurfaceHolder.lockCanvas(null);
mCanvas.drawBitmap(mBackgroundImage, 0, 0, null);

//to create an ImageView
mImageView = (ImageView)findViewById(R.id.imageview);
mImageView.setImageBitmap( currentprev );

//and also
mImageView = new ImageView(context)
mImageView.setImageBitmap( currentprev );

in all these instances, the canvas and Imageviews all stayed NULL variables after initialization. The code ran but when I got to the point of drawing them they returned null pointer exceptions.

The code that I am running is within a SurfaceView based on the API8 code for displaying the preview for a camera on the phone.