power1power1 Posted November 13, 2013 Share Posted November 13, 2013 Hello, The simple script ('?do=embed' frameborder='0' data-embedContent>>) works fine. I have Windows 8.1 with screen resolution of 1920x1080 and scaling level set at 132%. The reported coordinates at the bottom right corner is 1440x810. I think Firefox also reports that as the screen resolution. Any comments? Thanks! Link to comment Share on other sites More sharing options...
water Posted November 13, 2013 Share Posted November 13, 2013 What should your script return? The screen resolution (1920x1080) or the position of the mouse independant of the scaling level? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
power1power1 Posted November 13, 2013 Author Share Posted November 13, 2013 Well, when the mouse pointer is at the bottom right corner, I was expecting to get 1920x1080 rather than 1440x810 as the screen resolution is 1920x1080 ... I guess this is the new Windows 8.1 scaling effect, I didn't have this issue with Windows 8. Link to comment Share on other sites More sharing options...
water Posted November 13, 2013 Share Posted November 13, 2013 You could play with AutoItSetOption "MouseCoordMode" and / or "PixelCoordMode". My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
BrewManNH Posted November 13, 2013 Share Posted November 13, 2013 Your scaling level is affecting the coordinates, and you may be getting the coordinate above where the taskbar is on the screen instead of the screen resolution. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
power1power1 Posted November 13, 2013 Author Share Posted November 13, 2013 (edited) Thanks. Question: How do I get the screen scaling setting? Edited November 13, 2013 by power1power1 Link to comment Share on other sites More sharing options...
BrewManNH Posted November 13, 2013 Share Posted November 13, 2013 Why do you need the screen scaling settings? If the coordinates returned work, and I assume you tried using them, then there's no need to look for the setting. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
power1power1 Posted November 13, 2013 Author Share Posted November 13, 2013 (edited) For example, try this and you get a wrong pixel color. You would need to apply the screen scaling factor to $aPos. While 1 $aPos = MouseGetPos() $iColor = PixelGetColor($aPos[0], $aPos[1]) Tooltip($aPos[0] & ", " & $aPos[1] & ", " & Hex($iColor, 6)) Sleep (100) WEnd Edited November 13, 2013 by power1power1 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted November 13, 2013 Moderators Share Posted November 13, 2013 Can you explain exactly what you're trying to accomplish, and what application or window you're trying to manipulate? You're seeing how volatile using mouse coords can be; often there is a much easier way to do what you're trying to do. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
BrewManNH Posted November 13, 2013 Share Posted November 13, 2013 If MousePos is giving you that coordinate, how do you know that the PixelGetColor is returning the color from the wrong position? If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
power1power1 Posted November 13, 2013 Author Share Posted November 13, 2013 (edited) Trying the script, man! Edited November 13, 2013 by power1power1 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 13, 2013 Moderators Share Posted November 13, 2013 power1power1,Please keep calm. People are trying to help you and getting ratty with them will not get you very far. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
water Posted November 13, 2013 Share Posted November 13, 2013 And changing a post after you got warned doesn't help either My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
power1power1 Posted November 13, 2013 Author Share Posted November 13, 2013 water, I am not sure what you are talking about: At the moment, it shows my post was edited at 5 minutes ago and Melba 23 was posted at 4 minutes ago Link to comment Share on other sites More sharing options...
power1power1 Posted November 13, 2013 Author Share Posted November 13, 2013 Melba23, I am not sure what you are talking about either: The script is there to try. If anybody has any technical/professional comments regarding the subject, please do. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 13, 2013 Moderators Share Posted November 13, 2013 power1power1, Melba23, I am not sure what you are talking aboutA collection of hand-sized spherical objects! You know how that post read before you edited it. Now please get the thread back on track as I have enough to do elsewhere..... M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
power1power1 Posted November 13, 2013 Author Share Posted November 13, 2013 For the benefit of everybody, here it is: Post # 11 before: Try the script, man! Post # 11 after: Trying the script, man! Link to comment Share on other sites More sharing options...
Solution power1power1 Posted November 14, 2013 Author Solution Share Posted November 14, 2013 (edited) Using part of Yashied's script here: ('?do=embed' frameborder='0' data-embedContent>>), screen scaling factor can be calculated and the script in post #8 would show the correct color information: $scale = 0 _GetScale() While 1 $position = MouseGetPos() $color = PixelGetColor($position[0] * $scale, $position[1] * $scale) Tooltip("X=" & $position[0] & ", Y=" & $position[1] & ", RGB=0x" & Hex($color, 6), default, default, "Scaled Pixel Position and Hex Color:", 0, 4) Sleep (100) WEnd Exit Func _GetScale() $tDEVMODE = DllStructCreate('byte[32];dword[10];byte[32];dword[6]') $pDEVMODE = DllStructGetPtr($tDEVMODE) $i = 0 while 1 $ret = DllCall('user32.dll', 'int', 'EnumDisplaySettings', 'ptr', 0, 'dword', $i, 'ptr', $pDEVMODE) if ($ret[0] = 0) then exitloop $width = DllStructGetData($tDEVMODE, 4, 2) ; native width $i += 1 wend $scale = $width / @DesktopWidth EndFunc Edited November 14, 2013 by power1power1 duzers 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now