Start a new topic

Taking wikitude view screenshot with AR Objects on it ?

Taking wikitude view screenshot with AR Objects on it ?
1 Comment


Hi All,

I am trying to take a screenshot of wikitude camera view including AR Objects on the image. I went through entire wikitude documentaion and couldn't find any methods to achieve this. However i tried using core android methods i tried to take screenshot, but it is capturing only black screen with html elements on it (not AR Objects).

So i though it can achieved using some openGL method. So found out this code in stackoverflow, but unable to use this as GL10 gl  is not known as it should be from SurfaceView. And in wikitude i don't know how we can get GL10 instace.

 

public static Bitmap SavePixels(int x, int y, int w, int h, GL10 gl)
{
int b=new int;
int bt=new int;
IntBuffer ib=IntBuffer.wrap(b);
ib.position(0);
gl.glReadPixels(x, 0, w, y+h, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, ib);

for(int i=0, k=0; i<h; i++, k++)
{//remember, that OpenGL bitmap is incompatible with Android bitmap
//and so, some correction need.
for(int j=0; j<w; j++)
{
int pix=b;
int pb=(pix>>16)&0xff;
int pr=(pix<<16)&0x00ff0000;
int pix1=(pix&0xff00ff00) | pr | pb;
bt=pix1;
}
}


Bitmap sb=Bitmap.createBitmap(bt, w, h, Bitmap.Config.ARGB_8888);
return sb;
}

 

Please help me if anybody did tried it already or any suggestions would be great.

Thank You

Ravi Tamada
Login or Signup to post a comment