Hi,
I am trying to add an image on surface view.
I have coded some thing like this:
public void surfaceCreated(final SurfaceHolder holder)
{
// The Surface has been created, acquire the camera and
tell it where
// to draw.
Runnable r = new Runnable()
{
public void run()
{
Rect rect = new Rect();
rect.set(0, 0, 60, 60);
Canvas canvas =
mHolder.lockCanvas(rect);
InputStream is =
context.getResources().openRawResource
(R.drawable.karaoke48x48);
//Bitmap bitmap =
BitmapFactory.decodeResource(getResources
(), R.drawable.karaoke48x48);
Bitmap bitmap =
BitmapFactory.decodeStream(is);
Paint p = new Paint();
if(bitmap != null)
canvas.drawBitmap(bitmap, 0,0,
p);
mHolder.unlockCanvasAndPost(canvas);
//mHolder.
}
};
new Thread(r).start();
try
{
videoRecorder.setPreviewDisplay(mHolder.getSurface());
}
catch (Exception e)
{
e.printStackTrace();
}
if (videoRecorder != null)
{
try
{
videoRecorder.prepare();
System.out.println("video recorder
prepared.");
videoRecorder.start();
System.out.println("video recorder started.");
}
catch (IllegalStateException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (Exception ex)
{
ex.printStackTrace();
}
}
}
I got an image over the screen, but no preview is there.
But when I see the recorded media file, it is showing the recorded
video.
Can any one please help me to solve this?
Thanks,
Manoj.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---