Log in or register to post comments

Re sizing QCARSampleGLView

November 12, 2011 - 4:25am #1

Hello,

I want to resize the QCARSampleGLView(GLSurfaceView) and place it at any part of the screen eg vertical-center align. Please help me out.

Thanks

Re: Re sizing QCARSampleGLView

November 15, 2011 - 10:01am #6

Try getting this to work with a non-QCAR project first. Again, this isn't a use case we currently support. It should be possible, but I can't verify at this time.

- Kim

Re: Re sizing QCARSampleGLView

November 15, 2011 - 5:50am #5

Hi Kim,

I have tried a lot, but there is no parent defined for mGlView. When i tried to find getLeft() of getRight(), it was showing 00. Still have no clue get it into the center.

Rahul

Re: Re sizing QCARSampleGLView

November 14, 2011 - 7:03pm #4

Try changing main.xml to use a RelativeLayout. Then you should be able to use gravity settings to center things. You'll have to play around with it, I haven't tried this.

- Kim

Re: Re sizing QCARSampleGLView

November 13, 2011 - 11:15pm #3

Hi Kim,

Thanks for your reply. I have changed the camera surface size by giving the height and width in the addContentView. Code :-

addContentView(mGlView, new LayoutParams(
200,
300));

Now, i want to put this frame in the center of the screen.

Please help me.

Thanks

Rahul

Re: Re sizing QCARSampleGLView

November 12, 2011 - 9:59pm #2

This isn't a use case we test, but if you change the size and position of the view you'll need to update the configureVideoBackground method in native (e.g. ImageTargets.cpp). You can set the size and position of the VideoBackgroundConfig structure to match your new drawing rectangle. Note that this method currently sets the size to something larger than the screen in most cases, as the camera image typically has a different aspect ratio than the screen. You'll want to keep the camera aspect ratio intact, it's defined by videoMode width and height.

- Kim

Log in or register to post comments