Sign in to follow this  
Followers 0
MuffettsMan

Get Supported Resolutions

4 posts in this topic

Is it possible to get a list of available resoltions supported by a video card?

I know how to obtain the current resolution and i found the function to change resolutions but is it possible to read in an array of every resolution a card can handle?

depending on if its a decent videocard / laptop etc some boxes seem to only have a few where others have a ton.


Don't let that status fool you, I am no advanced memeber!

Share this post


Link to post
Share on other sites



yes... I don't remember the specifics... it is in the forum somewhere... someone should answer this soon... hang in there...

try searching for...

+display +settings

and look at some of the api for setting resolutions... the API will be there...

Lar.


f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

from 'Scriptomatic' by SvenP

look for 'Scriptomatic' on forum (see GEOSofts post below this one)

Some problems with return from WMI

problem1: 1 Hz resolution? Edit: should have been 'refresh'...

problem2: 4294967296 colors (8 extra bits for Alpha Channel)

could substitute values in array if you wish: 32 bit depth for 4294967296, 24 for 16,777,216 etc.

first array element is resolution count

Array display title is video adapter name and GPU

Edit: I commented out the additional res/col/refresh lines for clarity

more information is available, download scriptomatic and play with it.

BTW, unless you edit 'Scriptomatic' the 'Run' button wont work if I recall correctly,

so just select all and paste into SciTe. Read the thread for scriptomatic for the fix.

Edit2: removed unnecessary leftover lines from original scriptomatic example

Thanks GEOSoft for supplying the link

(I edited my copy and compiled some time ago, forgot the details of the fix)

#Include <Array.au3>
; Generated by AutoIt Scriptomatic

Dim $aVidRes[1]

$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
$strComputer = "localhost"

$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")

$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_VideoController", "WQL", _
                                          $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) then
   For $objItem In $colItems
      $VidCard = "Video Adapter:  " & $objItem.Caption
      $VidCard &= "   GPU:  " & $objItem.VideoProcessor
   Next
Endif

$colItems = $objWMIService.ExecQuery("SELECT * FROM CIM_VideoControllerResolution", "WQL", _
                                          $wbemFlagReturnImmediately + $wbemFlagForwardOnly)

If IsObj($colItems) then
   For $objItem In $colItems
       _ArrayAdd($aVidRes,$objItem.SettingID)
       ;_ArrayAdd($aVidRes,"Horz: "&$objItem.HorizontalResolution)
       ;_ArrayAdd($aVidRes,"Vert: "&$objItem.VerticalResolution)
       ;_ArrayAdd($aVidRes,"Col: "&$objItem.NumberOfColors)
       ;_ArrayAdd($aVidRes,"Refresh: "&$objItem.RefreshRate)
       $aVidRes[0] += 1
   Next
Else
   Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "CIM_VideoControllerResolution" )
Endif

_ArrayDisplay($aVidRes, $VidCard)oÝ÷ ÙìZ^Â+a(!z·(ìr§çm¡¸­²«¦,^«­¢+Ø%¹±Õ±ÐíÉÉä¹ÔÌÐì(ìY¥¼ÁÑÈÍÕÁÁ½Éѵ½Ì(ì½¹ÙÉÑ¡¥¡È½±½ÉÌ ©½±½ÕÉ̤Ѽ¥ÑÌÁÈÁ¥á°(ì¨U,½
¹ì¤()=ÁÐ Ìäí5ÕÍѱÉYÉÌÌäì°Ä¤)¥´ÀÌØíY¥IÍlÅt)1½°ÀÌØíY¥
É°ÀÌØí½°()±½°
½¹ÍÐÀÌØíݵ±IÑÕɹ%µµ¥Ñ±äôÁàÄÀ)±½°
½¹ÍÐÀÌØíݵ±½ÉÝÉ=¹±äôÁàÈÀ()1½°ÀÌØí½±%ѵÌôÅÕ½ÐìÅÕ½Ðì)1½°ÀÌØíÍÑÉ
½µÁÕÑÈôÅÕ½Ðí±½±¡½ÍÐÅÕ½Ðì()1½°ÀÌØí½©]5%MÉÙ¥ô=©Ð ÅÕ½ÐíÝ¥¹µµÑÌèÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØíÍÑÉ
½µÁÕÑȵÀìÅÕ½ÐìÀäÈíɽ½ÐÀäÈí
%5XÈÅÕ½Ðì¤((ÀÌØí½±%ѵÌôÀÌØí½©]5%MÉÙ¥¹áEÕÉä ÅÕ½ÐíM1
P¨I=4]¥¸ÌÉ}Y¥½
½¹Ñɽ±±ÈÅÕ½Ðì°ÅÕ½Ðí]E0ÅÕ½Ðì°|(ÀÌØíݵ±IÑÕɹ%µµ¥Ñ±ä¬ÀÌØíݵ±½ÉÝÉ=¹±ä¤)%%Í=¨ ÀÌØí½±%ѵ̤ѡ¸(½ÈÀÌØí½©%Ñ´%¸ÀÌØí½±%ѵÌ(ÀÌØíY¥
ÉôÅÕ½Ðí5½Ì½ÈY¥¼ÁÑÈèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹
ÁÑ¥½¸(ÀÌØíY¥
ɵÀìôÅÕ½ÐìATèÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹Y¥½AɽÍͽÈ(9áÐ)±Í(5ͽà À°ÅÕ½Ðí]5$=ÕÑÁÕÐÅÕ½Ðì°ÅÕ½Ðí9¼]5$=©Ñ̽չ½È±ÍÌèÅÕ½ÐìµÀìÅÕ½Ðí]¥¸ÌÉ}Y¥½
½¹Ñɽ±±ÈÅÕ½Ðì¤(á¥Ð)¹¥((ÀÌØí½±%ѵÌôÀÌØí½©]5%MÉÙ¥¹áEÕÉä ÅÕ½ÐíM1
P¨I=4
%5}Y¥½
½¹Ñɽ±±ÉIͽ±ÕÑ¥½¸ÅÕ½Ðì°ÅÕ½Ðí]E0ÅÕ½Ðì°|(ÀÌØíݵ±IÑÕɹ%µµ¥Ñ±ä¬ÀÌØíݵ±½ÉÝÉ=¹±ä¤()%%Í=¨ ÀÌØí½±%ѵ̤ѡ¸(½ÈÀÌØí½©%Ñ´%¸ÀÌØí½±%ѵÌ(MÝ¥Ñ ÀÌØí½©%Ñ´¹9ÕµÉ=
½±½ÉÌ(
ÍÄØ(ÀÌØí½°ôÅÕ½ÐìÄØ
½±½ÉÌÅÕ½Ðì(
ÍÈÔØ(ÀÌØí½°ôÅÕ½ÐìÈÔØ
½±½ÉÌÅÕ½Ðì(
ÍØÔÔÌØ(ÀÌØí½°ôÅÕ½ÐìÄØ   ÁÀÅÕ½Ðì(
ÍÄØÜÜÜÈÄØ(ÀÌØí½°ôÅÕ½ÐìÈÐ ÁÀÅÕ½Ðì(
ÍÐÈäÐäØÜÈäØ(ÀÌØí½°ôÅÕ½ÐìÌÈ ÁÀÅÕ½Ðì(¹MÝ¥Ñ (}ÉÉå ÀÌØíY¥IÌ°ÀÌØí½©%Ñ´¹!½É¥é½¹Ñ±Iͽ±ÕÑ¥½¸µÀìÅÕ½ÐìàÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹YÉÑ¥±Iͽ±ÕÑ¥½¸µÀìÅÕ½ÐìàÅÕ½ÐìµÀìÀÌØí½°µÀìÅÕ½ÐìÅÕ½ÐìµÀìÀÌØí½©%Ñ´¹IÉÍ¡IѵÀìÅÕ½Ðì!èÅÕ½Ðì¤(ÀÌØíY¥IÍlÁt¬ôÄ(9áÐ)±Í(5ͽà À°ÅÕ½Ðí]5$=ÕÑÁÕÐÅÕ½Ðì°ÅÕ½Ðí9¼]5$=©Ñ̽չ½È±ÍÌèÅÕ½ÐìµÀìÅÕ½Ðí
%5}Y¥½
½¹Ñɽ±±ÉIͽ±ÕÑ¥½¸ÅÕ½Ðì¤(á¥Ð)¹¥()}ÉÉå¥ÍÁ±ä ÀÌØíY¥IÌ°ÀÌØíY¥
ɤ
Edited by rover

I see fascists...

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

from 'Scriptomatic' by SvenP

look for 'Scriptomatic' on forum

BTW, unless you edit 'Scriptomatic' the 'Run' button wont work if I recall correctly,

so just select all and paste into SciTe. Read the thread for scriptomatic for the fix.

That only applied if it was compiled. I have a "fixed" compiled version available for download.

http://dundats.mvps.org/AutoIt/files/AI_Scriptomatic.zip

Edit: I have now added that link to my signature.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0