Jump to content











Photo
- - - - -

Setting screen resolution


  • Please log in to reply
7 replies to this topic

#1 spleenharvester

spleenharvester

    Member

  • Members
  • 91 posts
  •  
    United Kingdom

Posted 09 July 2016 - 03:20 PM

I found a really great little app called QRes that works in WinPE. https://sourceforge.net/projects/qres/

 

I've written a script that uses 'qres /l' to list available display modes, determines the highest res by multiplying the vertical and horizontal pixels and comparing, then 'qres /x:XXXX /y:YYYY' to set the resolution, and it appears to work very reliably on the few computers I've tested on, even without video drivers.

 

My only concern is that if QRes lists an invalid mode as available, is it possible that setting this mode to the laptop's display will possibly damage it? I don't know enough about how Windows handles output resolutions to know the answer. If you try and set a wonky resolution it will tell you it failed to set, but I'm concerned about a scenario in which the LCD is returning odd values as compatible.



#2 spleenharvester

spleenharvester

    Member

  • Members
  • 91 posts
  •  
    United Kingdom

Posted 09 July 2016 - 03:53 PM

Also here is the script for those curious. Assumes qres is in the Windows directory. The GTR/LSS lines are just there to prevent a resolution below 640x480 or above 2560x1600 being passed to qres. I call this into my startnet.cmd.

set current=0
for /f "skip=3 tokens=1 delims=," %%a in ('qres.exe /l') do (
set tmp=%%a
call :determinebest
)
if not defined current (
exit
)
if %current% GTR 4096000 (
exit
)
if %current% LSS 307200 (
exit
)
SET vres=%originaltemp:*x=%
call SET hres=%%originaltemp:%vres%=%%
set hres=%hres:x=%
qres.exe /x:%hres% /y:%vres%
exit

:determinebest
SET sumtemp=%tmp:x=*%
SET /a sumtemp2=%sumtemp%
if %sumtemp2% GTR %current% (
set current=%sumtemp2%
set originaltemp=%tmp%
)
exit /b

Edited by spleenharvester, 09 July 2016 - 04:03 PM.


#3 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13329 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 09 July 2016 - 05:38 PM

Well, nice approach :), but "conceptually wrong" :w00t: :ph34r:
A modern LCD monitor - unlike good ol' CRT ones has one (and one only) "native resolution".
 
Any other resolution but the native one will be "worse" than the "native" one.
 
See as an example the output of Dumpedid:
http://www.nirsoft.n.../dump_edid.html
C:\appoggio>DumpEDID.exe
DumpEDID v1.05
Copyright (c) 2006 - 2015 Nir Sofer
Web site: http://www.nirsoft.net

*****************************************************************
Active : Yes
Registry Key : DISPLAY\ACI22A2\5&2eaf1468&0&11335578&04&00
Monitor Name : VW222
Serial Number : 82LMQS015086
Manufacture Week : 7 / 2008
ManufacturerID : 26884 (0x6904)
ProductID : 8866 (0x22A2)
Serial Number (Numeric) : 16843009 (0x01010101)
EDID Version : 1.3
Display Gamma : 2.20
Vertical Frequency : 56 - 75 Hz
Horizontal Frequency : 31 - 81 KHz
Maximum Image Size : 47 X 30 cm (22.0 Inch)
Maximum Resolution : 1680 X 1050
Support Standby Mode : Yes
Support Suspend Mode : Yes
Support Low-Power Mode : Yes
Support Default GTF : No
Digital : No

Supported Display Modes :
720 X 400 70 Hz
640 X 480 60 Hz
640 X 480 67 Hz
640 X 480 72 Hz
640 X 480 75 Hz
800 X 600 56 Hz
800 X 600 60 Hz
800 X 600 72 Hz
800 X 600 75 Hz
832 X 624 75 Hz
1024 X 768 60 Hz
1024 X 768 70 Hz
1024 X 768 75 Hz
1152 X 864 75 Hz
1280 X 960 60 Hz
1440 X 900 60 Hz
1280 X 1024 60 Hz
1280 X 1024 75 Hz
1680 X 1050 60 Hz
1600 X 1200 60 Hz

*****************************************************************
 

The "correct" resolution is the:
 
Maximum Resolution : 1680 X 1050
Your algorithm - if I get it right - would have instead chosen 1600x1200=1920000>1680x1050=1764000
 
The above little thingy by Nirsoft has some provisions to detect the "Detailed Timing Descriptor" and should be as accurate as possible, compare with:
https://en.wikipedia...tive_resolution
https://en.wikipedia...tification_Data
https://en.wikipedia...ata#Limitations
BTW (and as a side note) I am not at all convinced (but I may well be wrong) that the Qres.exe that has a /L option actually comes from:
https://sourceforge.net/projects/qres/
(by Berent Engelbrecht)
but rather is the:
QRes v1.1
Copyright © Anders Kjersem
http://www.softpedia...ools/QRes.shtml

I would use the newer Dumpedid to check "native" resolution and then use Qres to set it.
:duff:
Wonko
  • spleenharvester likes this

#4 spleenharvester

spleenharvester

    Member

  • Members
  • 91 posts
  •  
    United Kingdom

Posted 09 July 2016 - 06:15 PM

Cheers for the reply - I did wonder if something like that was possible, my script would indeed select the "higher" res  :thumbsup: You are right about QRes too - the one I linked is a different project.

 

Unfortunately DumpEDID does not seem to work on the laptops I have used it on (possibly needs an external monitor?). WMIC desktopmonitor get returns "No instances available" either, presumably for the same reason.

 

It's a shame as there doesn't seem to be any other way to check the maximum/current native res!



#5 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13329 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 09 July 2016 - 06:42 PM

Cheers for the reply - I did wonder if something like that was possible, my script would indeed select the "higher" res  :thumbsup: You are right about QRes too - the one I linked is a different project.
 
Unfortunately DumpEDID does not seem to work on the laptops I have used it on (possibly needs an external monitor?). WMIC desktopmonitor get returns "No instances available" either, presumably for the same reason.
 
It's a shame as there doesn't seem to be any other way to check the maximum/current native res!

Cannot say, maybe it is a more generic issue with WMIC? :unsure:
Maybe the:
http://www.nirsoft.n..._info_view.html
will work?
Or Multimonitor?
http://www.nirsoft.n...nitor_tool.html

Mind you it is entirely possible that it is as you say a problem with EDID (which may be available only on desktops/external monitors).

Maybe (but it would be anyway not entirely accurate) you could add some checks for form factor/multiple of 8, etc. :dubbio: though a number of laptops may actually have "queer" resolutions. :(

:duff:
Wonko

#6 spleenharvester

spleenharvester

    Member

  • Members
  • 91 posts
  •  
    United Kingdom

Posted 09 July 2016 - 06:58 PM

Cannot say, maybe it is a more generic issue with WMIC? :unsure:
Maybe the:
http://www.nirsoft.n..._info_view.html
will work?
Or Multimonitor?
http://www.nirsoft.n...nitor_tool.html

Mind you it is entirely possible that it is as you say a problem with EDID (which may be available only on desktops/external monitors).

Maybe (but it would be anyway not entirely accurate) you could add some checks for form factor/multiple of 8, etc. :dubbio: though a number of laptops may actually have "queer" resolutions. :(

:duff:
Wonko

 

Neither MonitorInfo nor MultiMonitorTool pick up a display. I think I've found the problem, though - WinPE does not have the generic PnP monitor driver (monitor.sys). I'm going to try integrating this into my image and seeing if these tools start to work.

 

Cheers



#7 spleenharvester

spleenharvester

    Member

  • Members
  • 91 posts
  •  
    United Kingdom

Posted 09 July 2016 - 07:28 PM

Installed the driver (monitor.inf + monitor.sys through DISM), MultiMonitorTool now works (none of the others do though) - so now all I have to do is issue "MultiMonitorTool /setmax 1" on startup.  :)

 

Cheers!



#8 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13329 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 10 July 2016 - 07:41 AM

Good :)

:duff:
Wonko




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users