Log in or register to post comments

Add camera into a layout

March 28, 2012 - 2:22pm #1

How can I add camera into a layout. For example I want to show camera at the left of layout and at the right of layout, I want to show some informations about detected objects. I tried the following to test, it didn't work;

 
LinearLayout lay = new LinearLayout(ImageTargets.this);
                            addContentView(lay, new LayoutParams(
                                    LayoutParams.MATCH_PARENT,
                                    LayoutParams.FILL_PARENT));
                            lay.addView(mGlView);
                            Button btn = new Button(ImageTargets.this);
                            btn.setText("Megamind");
                            btn.setWidth(100);
                            btn.setHeight(30);
                            lay.addView(btn);

When I changed the adding order, just button is showed.

LinearLayout lay = new LinearLayout(ImageTargets.this);
                            addContentView(lay, new LayoutParams(
                                    LayoutParams.MATCH_PARENT,
                                    LayoutParams.FILL_PARENT));
 Button btn = new Button(ImageTargets.this);
                            btn.setText("Megamind");
                            btn.setWidth(100);
                            btn.setHeight(30);
                            lay.addView(btn);

                            lay.addView(mGlView);
                           

I tried to set content view as my layout object but it didn't work as others.

I need your help about that.

Add camera into a layout

March 31, 2014 - 6:01am #5

Hi, I'd like to do something similar. Did anyone figure out if it's possible? Thank you.

Re: Add camera into a layout

March 29, 2012 - 3:40pm #4

This isn't something I have tested. I'm not sure that it is supported, but I'm looking into it.

- Kim

Re: Add camera into a layout

March 28, 2012 - 9:36pm #3

Actually, I am starter for Vuforia. I supose that glSurfaceView is camera container. I don't want keep it full-screen, I want to keep it at the half of the screen. suppose the brackets are screen :
[a layout(25% width) | camera (75% width)]

Re: Add camera into a layout

March 28, 2012 - 8:55pm #2

I think you want to keep the glView at fullscreen. You can try changing the viewport that is used for OpenGL rendering, however. For this you'll need to edit the configureVideoBackground method to use a different size and position for the video background. Then use a different viewport when rendering your content.

- Kim

Log in or register to post comments