dersiniar Posted January 21, 2023 Share Posted January 21, 2023 Autoit windof info show pixel colors wrongly. I had problems with my script, i made another script to get pixel info to my mouse, and its different then autoit window info shows. How to fix it? Link to comment Share on other sites More sharing options...
Dan_555 Posted January 21, 2023 Share Posted January 21, 2023 (edited) Take a screenshot of your desktop, paste it into (Windows)Paint or other painting app, use a color picker tool and search for the coordinates. Then pick up the color, and click on edit colors, then look if the color matches. When i look on your pasted image, the coordinate for 42,426 is somewhere inside the MS-Edge icon. The color 2b1060 is dark purple. (looking at the pasted image, it's somewhere inside the CPUID icon. The color ffd971 is the yellow'ish color. Edited January 21, 2023 by Dan_555 Some of my script sourcecode Link to comment Share on other sites More sharing options...
dersiniar Posted January 28, 2023 Author Share Posted January 28, 2023 How can i fix this thing? Im using win 11 and scite version 4.4.6 Link to comment Share on other sites More sharing options...
ioa747 Posted January 28, 2023 Share Posted January 28, 2023 (edited) On 1/21/2023 at 4:10 PM, dersiniar said: made another script to get pixel info to my mouse, i thing something is wrong with your script. have you tried another tool? https://getsharex.com/ RGBA (Red, Green, Blue, Alpha) = 1, 0, 128, 255 HSB (Hue, Saturation, Brightness) = 240,5°, 100,0%, 50,2% CMYK (Cyan, Magenta, Yellow, Key) = 99,2%, 100,0%, 0,0%, 49,8% Hex (RGB, RGBA, ARGB) = #010080, #010080FF, #FF010080 Decimal (RGB, RGBA, ARGB) = 65664, 16810239, -16711552 Cursor position (X, Y) = 1019, 473 your value 0x1C1C1C not mach to any format RGBA (Red, Green, Blue, Alpha) = 28, 28, 28, 255 HSB (Hue, Saturation, Brightness) = 0,0°, 0,0%, 11,0% CMYK (Cyan, Magenta, Yellow, Key) = 0,0%, 0,0%, 0,0%, 89,0% Hex (RGB, RGBA, ARGB) = #1C1C1C, #1C1C1CFF, #FF1C1C1C Decimal (RGB, RGBA, ARGB) = 1842204, 471604479, -14935012 Cursor position (X, Y) = 1019, 473 Edited April 2, 2023 by ioa747 UpDate I know that I know nothing Link to comment Share on other sites More sharing options...
Dan_555 Posted January 28, 2023 Share Posted January 28, 2023 You need to give us more informations. 1) You can test another script like this one: (1st post) 2) Paste your script so that we may test it on our machines. Some of my script sourcecode Link to comment Share on other sites More sharing options...
dersiniar Posted January 28, 2023 Author Share Posted January 28, 2023 Its not about script tbh then script gives my right colors. ones that i can use for scite. Problem is autoit window info, it gives wrong codes. Codes that script wont reconise. but heres the script i used to get codes that works for me. but i want to get autoit info tool to working. HotKeySet("{ESC}", "Terminate") HotKeySet("q", "Color") Local $aMPos While 1 $aMPos = MouseGetPos() $Data= ToolTip($aMPos[0] & ", " & $aMPos[1] & @LF & "0x" & Hex(PixelGetColor($aMPos[0], $aMPos[1]), 6)) Sleep(10) WEnd ToolTip Func Color() ClipPut ( "0x" & Hex(PixelGetColor($aMPos[0], $aMPos[1]), 6)) ToolTip("Saved "& "0x" &Hex(PixelGetColor($aMPos[0], $aMPos[1]), 6)) Sleep (1000) EndFunc ;==>Terminate Func Terminate() Exit 0 EndFunc ;==>Terminate Link to comment Share on other sites More sharing options...
Developers Jos Posted January 28, 2023 Developers Share Posted January 28, 2023 probably DPI scaling: https://www.autoitscript.com/trac/autoit/ticket/3238 Dan_555 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Dan_555 Posted January 28, 2023 Share Posted January 28, 2023 Hmm. When i use your script and au3info (at the same time), both are showing me the exact same colors for all the spots that i have tried. I'm on windows 10 ... Some of my script sourcecode Link to comment Share on other sites More sharing options...
Dan_555 Posted January 28, 2023 Share Posted January 28, 2023 I can confirm that it is up to the scaling factor. Just tested it on my machine. Even the taking of the screenshots does not resemble the position of the mouse. expandcollapse popup;modified from https://www.autoitscript.com/forum/topic/41652-colorpicker/ #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ScreenCapture.au3> #include <StaticConstants.au3> #include <WinAPIHObj.au3> #include <WindowsConstants.au3> #include <String.au3> #include <Misc.au3> GUICreate("ColorPicker: Press CTRL/Strg", 258, 120, -1, -1, -1, $ws_ex_topmost + $ws_ex_toolwindow) GUISetFont(9, 400, 0, "Verdana") $lbl_color = GUICtrlCreateLabel("", 10, 35, 70, 54, $ss_center + $ss_centerimage + $ss_sunken ) GUICtrlSetFont(-1, 9, 600) $lbl_hex = GUICtrlCreateLabel("0x", 10, 10, 70, 20, $ss_center + $ss_sunken + $ss_centerimage) Global $hgpic = GUICtrlCreatePic("", 85, 10, 80, 80,$SS_SUNKEN) $cmd_copy = GuiCtrlCreateButton("", 200, 9, 49, 25, $bs_icon) GUICtrlSetImage($cmd_copy, "shell32.dll", 134, 0) GUICtrlSetTip($cmd_copy, "Get Screen by coordinates") $Label1 = GUICtrlCreateLabel("X=", 175, 43, 17, 17) $Label2 = GUICtrlCreateLabel("Y=", 175, 62, 17, 17) $Input1 = GUICtrlCreateInput("0", 200, 40, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_NUMBER)) $Input2 = GUICtrlCreateInput("0", 200, 60, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_NUMBER)) $lbl_Mouse = GUICtrlCreateLabel("x=0 : y=0", 10, 95, 238, 20, $ss_sunken + $ss_centerimage) $last = 0 GUISetState() While 1 $msg = GUIGetMsg() $col = PixelGetColor(MouseGetPos(0), MouseGetPos(1)) Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $col <> $last And GUICtrlRead($lbl_color) = "" GUICtrlSetData($lbl_hex, "0x" & Hex($col, 6)) GUICtrlSetBkColor($lbl_color, "0x" & Hex($col, 6)) $last = $col Case _IsPressed("11") = 1 If GUICtrlRead($lbl_color) = "[Lock]" Then GUICtrlSetData($lbl_color, "") Else $mx = MouseGetPos(0) $my = MouseGetPos(1) GUICtrlSetData ($lbl_Mouse,"X= "& $mx & _StringRepeat(" ",7-StringLen($mx)) & "Y=" & $my) ScreenCaptureToControl($hgpic,$mx-40,$my-40,$mx+40,$my+40) GUICtrlSetData($lbl_color, "[Lock]") If $col < 3000000 Then GUICtrlSetColor($lbl_color, 0xFFFFFF) Else GUICtrlSetColor($lbl_color, 0x000000) EndIf EndIf Sleep(200) Case $msg = $cmd_copy $mx = GUICtrlRead($Input1) $my = GUICtrlRead($Input2) ScreenCaptureToControl($hgpic,$mx-40,$my-40,$mx+40,$my+40) EndSelect WEnd Exit Func ScreenCaptureToControl($hPicControlId,$x,$y,$x1,$y1) ;used the code from https://www.autoitscript.com/forum/topic/191425-capturing-image-without-saving/ Local $hBmp = _ScreenCapture_Capture("", $x, $y , $x1 , $y1,False) GUICtrlSendMsg($hPicControlId, $STM_SETIMAGE, $IMAGE_BITMAP, $hBmp) _WinAPI_DeleteObject($hBmp) EndFunc ;==>SlideShow_Preview Some of my script sourcecode Link to comment Share on other sites More sharing options...
ioa747 Posted January 28, 2023 Share Posted January 28, 2023 sorry for the misunderstanding. But the cross points to blue, the info tool says blue, while the tooltip says 0x1C1C1C black. I assumed you pointing the blue I know that I know nothing 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