Hi All,
Thanks in advance to all the helpers.
I want to change screen resolution using ruby or selenium.
Please help me and let me know if it is possible in either way.
Hi All,
Thanks in advance to all the helpers.
I want to change screen resolution using ruby or selenium.
Please help me and let me know if it is possible in either way.
Saturn wrote:
Hi All,
Thanks in advance to all the helpers.I want to change screen resolution using ruby or selenium.
Please help me and let me know if it is possible in either way.
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
Saturn wrote:
Hi All,
Thanks in advance to all the helpers.I want to change screen resolution using ruby or selenium.
Please help me and let me know if it is possible in either way.
For Windows, there’s a WinAPI function I think, but I don’t know about
Linux or Mac OS.
Btw. is there any good reference on how to manipulate the X server? I’d
like to add some more automation functions to my xdo gem, but I wasn’t
able to find out how to interact directly with X…
Marvin
On Nov 11, 12:26 am, Marvin Gülker [email protected] wrote:
Btw. is there any good reference on how to manipulate the X server? I’d
like to add some more automation functions to my xdo gem, but I wasn’t
able to find out how to interact directly with X…Marvin
Posted viahttp://www.ruby-forum.com/.
Yes I need to change screen resolution itself like from 1280 X 800 to
800 X 600.
I can read the resolutions through win API but can’t write
If you any way to change please let me know
Saturn wrote:
On Nov 11, 12:26�am, Marvin G�lker [email protected] wrote:
Btw. is there any good reference on how to manipulate the X server? I’d
like to add some more automation functions to my xdo gem, but I wasn’t
able to find out how to interact directly with X…Marvin
Posted viahttp://www.ruby-forum.com/.
Yes I need to change screen resolution itself like from 1280 X 800 to
800 X 600.
I can read the resolutions through win API but can’t write
If you any way to change please let me know
- thanks
I’ve searched through Google and the Windows API, and found that this
function can do the trick: ChangeDisplaySettings
An article on how to use it I found here:
You could use the function itself easily, but building up the DEVMODE
struct seems to be very complex (note that I’m using the win32-api gem
for such tasks). In C, you only have to change the values of a DEVMODE
you want to change, but since you can’t access a struct from within
Ruby, you have to build up the whole struct and then use Array#pack to
turn it into a string which you can pass into the WinAPI function.
That’s no problem with easy structs like the POINT struct - just do [0,
0].pack(‘LL’) - but I’ve never found out how to manage that with complex
ones, especially with ones containing other structs. If someone knows
how to simplify that (besides a C extension written for the
MSVC-compiled Ruby version), please let me know.
Marvin
Thanks Marvin,
As you said problem is same here, I am unable to make it’s arguments:
I tried following:
require ‘Win32API’
@e = Win32API.new(“user32”,“ChangeDisplaySettings”, [‘I’,‘I’], ‘I’ )
p @e.call(800, 600)
it’s giving me error Or nothing if I remove p from the last line.
If any body has a clean solution like initialized all other DEVMODE
settings with default and changing only resolution part please let me
know.
Thanks for helping me.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs