How to take screenshot?

+1 vote
asked Feb 28, 2018 by amangrover (260 points)
How can I capture current screen (screenshot) when the target is recognized?

2 Answers

0 votes
answered Mar 2, 2018 by qcode-linus (330 points)

hi there,

try something like this in Unity:

void LateUpdate(){

...

takeHiResShot |= Input.GetKeyDown ("s");

if (takeHiResShot) {

ScreenCapture.CaptureScreenshot (<pathname>);

takeHiResShot = false;

}

...

}

the Input "s" the "s" on the Keyboard..

you can do something like this to do it with an GUI.Button (do not delete the EventSystem in the Unity scene and add the objcet with the script to the onClick function at the inspector of the button and choose the TakeHiResShot function):

public void TakeHiResShot(){

 takeHiresShot = true;

}

Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...