Log in or register to post comments

using view(as webview) as texture in cloudreco

January 6, 2013 - 11:14pm #1

hi

can i use android views(such as webview or layout) as texture in cloud reco sample,so far i found bitmap and video is used as texture.

using view(as webview) as texture in cloudreco

May 9, 2017 - 1:06pm #5

To add on to this question: 

Instead of using webview as texture for openGL drawing, is there another way to draw/position webview so that it align with image target, and also keep the normal webview behaviors (such as click, swipe, etc.)?

Thanks.

No, that won't be possible,

January 7, 2013 - 1:31am #4

No, that won't be possible, because to have that behaviour (click, etc.) you would need to attach the view/layout to your Activity content view (i.e. render the view in 2D like in a usual Android application), so that Android can traverse your view and analyzie your touch inputs.

If you want to achieve buttons functionalities on the OpenGL texture in 3D, you would need to implement your own raycasting algorithm, but that's a far more complex approach.

 

thanks for your reply,but it

January 7, 2013 - 1:26am #3

thanks for your reply,but it will be possible to have normal behavier of webview such as onclick etc on different subviews(buttons etc)?

Hi yogendra, it should be

January 7, 2013 - 12:51am #2

Hi yogendra,

it should be perfectly possible to do what you ask for;

if you take a look at the file "CloudReco.java", you should be able to find this code (and its surrounding code):

    Bitmap bitmap = Bitmap.createBitmap(mTextureSize, mTextureSize, Bitmap.Config.ARGB_8888);

    Canvas c = new Canvas(bitmap);

    productView.draw(c);

This shows precisely how to build a Bitmap out of a custom Android view/layout (which is made up of several sub-views, btw); the Bitmap can then be used to build a texture (this is also shown in the sample code), like any other Bitmap.

IHTH.

Log in or register to post comments