By masbejo40
on Sun, 05/19/2013 - 09:18
i want to capture ar view in my app.
i have been read this thread:https://developer.vuforia.com/forum/faq/android-how-can-i-capture-ar-view
and i also do what AlessandroB say on this thread:
https://developer.vuforia.com/forum/qcar-api/how-make-screenshot
i try on my project, it didn't show anyerror. but i also didn't got my screenshot.
i didn't see any error in LogCat. i think i must show my code to you, so this my code on ImageTargetsRendered.java
public boolean mTakeScreenshot = false; public void takeScreenshot() { mTakeScreenshot = true; } public void onDrawFrame(GL10 gl) { if (!mIsActive) return; // Update render view (projection matrix and viewport) if needed: //mActivity.updateRenderView(); // Call our native function to render content renderFrame(); // make sure the OpenGL rendering is finalized GLES20.glFinish(); if (mTakeScreenshot==true) { saveScreenShot(0, 0, mViewWidth, mViewHeight, "test.png"); mTakeScreenshot = false; } }
|
that the last part from your code and i add takeScreenshot method that i call in ImageTargets.java with this code:
public void takeScreenshot2(View view) { ImageTargetsRenderer ambil = new ImageTargetsRenderer(); button1.setVisibility(View.INVISIBLE); ambil.takeScreenshot(); button1.setVisibility(View.VISIBLE); }
there is any wrong code that i add??
How to capture AR view
Hi, I don't see why you instantiate a new Renderer in takeScreenshot2
How to capture AR view
did you mean this code "mRenderer = new ImageTargetsRenderer();" ?
owh yes, that the problem. i got my screenshot. thanks for your help.
How to capture AR view
you're welcome
How to capture AR view
Hi Guys,
I am looking to integrate this in the CloudReco example. For this I followed the post https://developer.vuforia.com/forum/faq/android-how-can-i-capture-ar-view.
I'm setting the flag to take screenshot on click of button in CloudReco.java.
How to capture AR view
Hi,
what does your takeScreenshot method does exactly ?
How to capture AR view
takeScreenShot method just sets the flag to take snapshot.
public void takeScreenShot(){
How to capture AR view
Just for confirmation, do you see the 3D augmentation on the screen at the time when you click the button to save the screenshot ?
How to capture AR view
I have some imageView being displayed on the camera_overlay_layout. The intent is to take a screenshot with this imageview and the video background.
I have these images being displayed on the screen when I press the capture button.
How to capture AR view
I can share the code for CloudReco and Renderer from theproject to help you understand it better. Please let me know
How to capture AR view
If you are trying to capture the overlay too, that will not work, because the technique that I illustrate to capture the AR view is only meant for capturing OpenGL-based content.
How to capture AR view
Thanks for your assistance.
I tried the following piece to save the screenshot of the content view (overlay). This works fine to save the overlay content albeit with a black background.
How to capture AR view
If you can capture the overlayView (with black background) and the underlying AR view in 2 separate bitmaps,
then what you could try is to combine those bitmaps into one, by manipulating their pixels;