Hello all,
I have been playing with Android for a couple of months, so I'm still
kindof newbie on this. I've looking for previous questions like mine,
but I was unable to find any proper solution. So here goes my
question:
I'm trying to draw a Camera Preview in a certain part of the screen
(for instance, square upper-left). So what I suppose I should do is
the following:
//My main activity
//Object preview, which extends from SurfaceView implements
SurfaceHolder.Callback
Preview camPreview;
[...]
setContentView(camPreview); //set preview as activity content
And on the Preview Class I have the following lines:
public void surfaceCreated(SurfaceHolder holder) {
// The Surface has been created, acquire the camera and tell
// to draw.
mCamera = Camera.open();
try {
//Trying to set up the PreviewSize, to embed it into the upper-
left square
Camera.Parameters parameters = mCamera.getParameters();
parameters.setPreviewSize(50, 50);
mCamera.setParameters(parameters);
mCamera.setPreviewDisplay(holder);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
The preview is still occuping all the screen, so I bet I
missunderstood something in the manuals :S. For the first touch with
Android I found the views / layouts / organizational concepts pretty
confusing, though.
Does anyone have any suggestion about what I can check, in order to
achieve it?
Thank you in advance, and regards,
Enrique
--
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