find out and change my SCREEN RESOLUTION with jython

Asked by german egg

i would like to use jython to find out the screen resolution... and to be able to change it.

is this possible without importing additional modules?

(i need this for both: windows and mac os)

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

changing Screen resolution: not a feature of Sikuli.

... and not Jython either.

If you talk about Jython, it is generally Java, that you can use seamlessly from within Jython scripts (the features of Sikuli itself are programmed in Java with some native support modules written in C++).

So you better have a look into the Java domain, wether your needs are met there.

BTW: in all Java based solutions like Jython, Jruby, Scala, Groovy, Clojure, ... special needs can in most cases only be solved by "importing additional modules" ore even third party software.

Revision history for this message
j (j-the-k) said :
#2

In Sikuli you can find out your resolution with the SCREEN-Region.
E.g. use print SCREEN to show the screen resolution or get the resolution with SCREEN.getH() and SCREEN.getW()
However you cannot change the SCREEN resolution directly.
I don't know why you need to change of the resolution, but if it's only for Sikuli, you could change the part of the screen that Sikuli uses to search for images by SCREEN.setH() and SCREEN.setW().

Revision history for this message
german egg (principito) said :
#3

THANK YOU so much for the superfast answeres so far!

where can i find an overview of those java modules, so that i know what java-module to import into jython and what the variables are that i need to use with that java-module?

Revision history for this message
RaiMan (raimund-hocke) said :
#4

If you are talking about the Sikuli features:

The best start: http://sikuli.org/docx/

The piece that talks about Sikuli and Java: http://sikuli.org/docx/faq/030-java-dev.html

And finally the API doc: http://sikuli.org/doc/java-x/

But if you are scripting in Jython, you can use the Python API as shown in http://sikuli.org/docx/

The prerequisites are the same as when using Eclipse or Netbeans with there Python plugins:
http://sikuli.org/docx/faq/040-other-ide.html#how-to-use-sikuli-together-with-other-ide-s

Can you help with this problem?

Provide an answer of your own, or ask german egg for more information if necessary.

To post a message you must log in.