Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getScreenshot() returns empty Object #327

Open
ender02 opened this issue May 17, 2020 · 1 comment
Open

getScreenshot() returns empty Object #327

ender02 opened this issue May 17, 2020 · 1 comment

Comments

@ender02
Copy link

ender02 commented May 17, 2020

All other functions are working like Click, Swipe, etc. But getScreenshot() not.
This code

var img = getScreenshot();
console.log(img);

Returns:
[object Object]

I work with visual studio code. But I also tried running the script in the Robotmon App, same empty result. I tried with Nox as emulator, on 2 real phones with Android 6.0 and also latest android versions. Same problem everywhere.

What can be the problem? Any idea guys? Do I miss something?

@ender02 ender02 changed the title getScreenshot() returning empty Object getScreenshot() returns empty Object May 17, 2020
@poi5305
Copy link
Contributor

poi5305 commented May 17, 2020

It might not be empty, [object Object] is pointing to a memory address.

Try this

var img = getScreenshot();
var colors = getImageColor(img, 0, 0);
releaseImage(img);
console.log(JSON.stringify(colors));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants