Jump to content

Show color with guy


akroon
 Share

Go to solution Solved by l3ill,

Recommended Posts

  • Moderators

akroon,

GUISetBkColor - the Help file tells you the rest. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

akroon,

Do mean a colour selection tool? If so the _ChooseColor is what you are looking for. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Sorry, maybe i don't explain so good what i need. I want show what pixel color i get with function pixelgetcolor. I can set color of a label or other gui, i'm just looking for a this gui where i use just for show color.

Sorry for my english.

Thanx.

Link to comment
Share on other sites

Hi akroon,

  I think you mean you want a rectangle (or similar) in your GUI that shows what color you have dynamically with PixelGetColor?

If yes,  I have never done this but you can look at GUICtrlSetGraphic. See below

Bill

Edited by l3ill
Link to comment
Share on other sites

  • Solution

Okay Now I have:
 
I found this very cool Mouse Finder Tool I while back (wish I knew who it came from)
And added the above mentioned functionality:  (uses GUICtrlCreateGraphic and PixelGetColor)

To update the GUI with the actual color while writing the Hex to the console.

#include <Misc.au3>
#include <GuiConstants.au3>
Global $iColor
$GUICoord = GUICreate('Mouse Finder Tool', '150', '40', '-1', '-1', '-1', '128')
Global $CoordInput = GUICtrlCreateInput('', '0', '0', '150', '20', '1')
GUICtrlSetFont($CoordInput, '9', '600', '', 'Arial')
$rectColor = GUICtrlCreateGraphic(-1, 20, 150, 20)
GUISetState(@SW_SHOW, $GUICoord)
WinSetOnTop($GUICoord, '', '1')
AdlibRegister("RefreshCoord", 50)

Local $hDLL = DllOpen("user32.dll")

While 1
    If _IsPressed("01", $hDLL) Then
        $Pos = MouseGetPos()
        ConsoleWrite("Mouse Coords are : X: " & $Pos['0'] & "  Y: " & $Pos['1'] & @CRLF)
         GUICtrlSetBkColor($rectColor, $iColor)
         ConsoleWrite("Picked Color is : " & Hex ($iColor) & @CRLF)

        While _IsPressed("01")
            Sleep(1)
        WEnd
    EndIf
    If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop
WEnd

DllClose($hDLL)
AdlibUnRegister("RefreshCoord")
GUIDelete($GUICoord)

Func RefreshCoord()
    $Pos = MouseGetPos()
    GUICtrlSetData($CoordInput, "X: " & $Pos['0'] & "  Y: " & $Pos['1'])
    $iColor = PixelGetColor($Pos['0'],$Pos['1'])
EndFunc
Edited by l3ill
Link to comment
Share on other sites

 

Okay Now I have:

 

I found this very cool Mouse Finder Tool I while back (wish I knew who it came from)

And added the above mentioned functionality:  (uses GUICtrlCreateGraphic and PixelGetColor)

To update the GUI with the actual color while writing the Hex to the console.

#include <Misc.au3>
#include <GuiConstants.au3>
Global $iColor
$GUICoord = GUICreate('Mouse Finder Tool', '150', '40', '-1', '-1', '-1', '128')
Global $CoordInput = GUICtrlCreateInput('', '0', '0', '150', '20', '1')
GUICtrlSetFont($CoordInput, '9', '600', '', 'Arial')
$rectColor = GUICtrlCreateGraphic(-1, 20, 150, 20)
GUISetState(@SW_SHOW, $GUICoord)
WinSetOnTop($GUICoord, '', '1')
AdlibRegister("RefreshCoord", 50)

Local $hDLL = DllOpen("user32.dll")

While 1
    If _IsPressed("01", $hDLL) Then
        $Pos = MouseGetPos()
        ConsoleWrite("Mouse Coords are : X: " & $Pos['0'] & "  Y: " & $Pos['1'] & @CRLF)
         GUICtrlSetBkColor($rectColor, $iColor)
         ConsoleWrite("Picked Color is : " & Hex ($iColor) & @CRLF)

        While _IsPressed("01")
            Sleep(1)
        WEnd
    EndIf
    If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop
WEnd

DllClose($hDLL)
AdlibUnRegister("RefreshCoord")
GUIDelete($GUICoord)

Func RefreshCoord()
    $Pos = MouseGetPos()
    GUICtrlSetData($CoordInput, "X: " & $Pos['0'] & "  Y: " & $Pos['1'])
    $iColor = PixelGetColor($Pos['0'],$Pos['1'])
EndFunc

 

Yea! That's realy what i need. Thank you so much    :thumbsup:    :thumbsup:

Edited by akroon
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...