简体   繁体   中英

How to get pixel color from oracle VM

I have a script written in Java that takes a pixelcolor with the getPixelColor method from the Java Robot class and compares it with another color to see if they are the same. It works fine on my pc, but when i use it in the Oracle VM VirtualBox with a windows 10 installed the pixels always give a white Color. (HSB 0,0,1). Is there a way to get the pixel colors from within the vm? Am i missing a setting or should i change my code?

Here are pictures of the code and results: this is the code that checks if the colors match, with a certain tolerance, it returns a boolean These are the printed results: if all ToCompare values lie between targetplus and targetmin it will return a true

This is my first question so be gentle :).

经过更多搜索后,我发现Robot类可以从vm内部获取颜色,我在代码的其他部分犯了一个错误,并且由于多线程(在vm运行在1个线程上的情况),我的功能有些中断)(通过更改虚拟机设置解决)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM