1 Color grabb :) Wed Sep 08, 2010 11:15 pm
Sound
Undertaker
this is not my color grab it is cakes but ti decided to release it 1. open up au3
2.Past code and use it done :3
2.Past code and use it done :3
- Code:
#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=..\Icons\cake1.ico
#AutoIt3Wrapper_outfile=..\Color Grab.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstants.au3>
#include <Color.au3>
Global $Pixel_Last, $Pixel_RGB
HotKeySet("{F10}","clipHex")
HotKeySet("{F11}","clipRGB")
AutoItSetOption("GuiOnEventMode", 1)
GUICreate("Color Grab", 337, 160, 797, 354)
GUICtrlCreateGroup("Hex Color", 12, 8, 153, 65)
$HexLabel = GUICtrlCreateLabel("Label1", 50, 32, 90, 21)
GUICtrlCreateGroup("RGB Color", 12, 80, 153, 65)
$RGBLabel = GUICtrlCreateLabel("Label2", 50, 102, 90, 21)
$showcolor = GUICtrlCreateGraphic(175,17,153,126)
GUICtrlSetBkColor(-1,0x000000)
GUISetOnEvent($GUI_EVENT_CLOSE,"close")
GUISetState(@SW_SHOW)
AdlibRegister("grab",100)
While 1
WEnd
Func grab()
$pos = MouseGetPos()
$pixel_hex = hex(PixelGetColor($pos[0],$pos[1]),6)
$pixel_rgb = __ColorGetRGB("0x"&$pixel_hex)
If $pixel_last <> $pixel_hex Then
GUICtrlSetData($HexLabel, "#" & $pixel_hex)
GUICtrlSetData($RGBLabel, $pixel_rgb)
GUICtrlSetBkColor($showcolor,"0x"&$pixel_hex)
EndIf
$Pixel_Last = $Pixel_Hex
EndFunc
Func __ColorGetRGB($nColor)
Return _ColorGetRed($nColor) & " " & _ColorGetGreen($nColor) & " " & _ColorGetBlue($nColor)
EndFunc
Func clipHex()
ClipPut ("#" & $pixel_last)
EndFunc
Func clipRGB()
ClipPut($pixel_rgb)
EndFunc
Func close()
Exit
EndFunc