← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #182893]: I changed a different size monitor , the pics cannot be recognized

 

Question #182893 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/182893

RaiMan posted a new comment:
The following solution can be integrated a bit easier into a Sikuli
script, because you do not need an extra .vbs script file.

It uses the reg command.

import os
regKey = r"HKCU\Control Panel\Desktop\WindowMetrics"
regField = "AppliedDPI"
cmd = 'reg QUERY "%s" /v %s'%(regKey, regField)
result= os.popen(cmd).readlines()
print eval(result[-2].strip().split()[-1]), "DPI"

The last statement builds on the knowledge, how the output of the reg
command looks like, and prints the DPI as decimal value.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.