Feonixx Posted July 3, 2008 Share Posted July 3, 2008 Hey guys, was wondering if it was possible to impliment a Color picker into an autoit program. Something like a color dropper u can drag onto the screen, and it will pick the certain color, and then do actions with clicking based on that selected color. Thanks in advance for any help xD Link to comment Share on other sites More sharing options...
NELyon Posted July 3, 2008 Share Posted July 3, 2008 You can choose a color with _ChooseColor. I use this to get the hex value of a color on the screen (Whipped up in like 10 minutes last month) #include <GUIConstantsEx.au3> #Include <Misc.au3> #include <EditConstants.au3> Global $nCont = 0, $xColor = 0x000000, $iRunning = False $hGUI = GUICreate("ColorSelect_Tool", 220, 110, -1, -1) WinSetOnTop($hGUI, "", 1) $hColor = GUICtrlCreateLabel("", 0, 0, 50, 50) $hSelectColorFromScreen = GUICtrlCreateButton("Select Color from Screen", 70, 0) $hHex = GUICtrlCreateInput("", 1, 70, 100, -1, $ES_READONLY) GUICtrlSetBkColor($hHex, 0xFFFFFF) GUISetState() While 1 If GUIGetMsg() = $hSelectColorFromScreen Then Do If PixelGetColor(MouseGetPos(0), MouseGetPos(1)) <> $xColor Then $xColor = PixelGetColor(MouseGetPos(0), MouseGetPos(1)) GUICtrlSetBkColor($hColor, $xColor) GUICtrlSetData($hHex, "0x" & StringRight(Hex($xColor), 6)) EndIf Until _IsPressed(01) EndIf If GUIGetMsg() = -3 Then Exit EndIf WEnd Click Choose Color, and then click in any spot to "Freeze" it. Link to comment Share on other sites More sharing options...
Feonixx Posted July 4, 2008 Author Share Posted July 4, 2008 Thanks a ton!!! Awesome script muttley Link to comment Share on other sites More sharing options...
ChrisL Posted July 4, 2008 Share Posted July 4, 2008 (edited) Look at _ChooseColor() in the help file Edited July 4, 2008 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire 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