I\'m using Camera API and invoking the camera.
I want to display a header (for branding) on the top of the camera preview. The header is a jpeg image.
Is
A workaround alternative is to overlay the Activity XML file with another XML file which contains the header image. To do so:
overlay.xmlInsert an ImageView inside it, something like:
Then inside the Activity java file, ie MotionDetector.java file ,
create a new method addView() :
private void addView()
{
controlInflater = LayoutInflater.from(getBaseContext());
View viewControl = controlInflater.inflate(R.layout.overlay, null);
LayoutParams layoutParamsControl = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
this.addContentView(viewControl, layoutParamsControl);
}
Finally invoke the addView() method from onCreate() to add the image:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.header);
addView();
Then end result would be an image overlay above the SurfaceView. Subject to the quality of the header image, the rendered quality of the header shall seem original. Hope it helps.