Sign in to follow this  
Followers 0
akroon

Show color with guy

9 posts in this topic

Hy all how i can show a color with a GUI? I don't want color any label, i want a GUI like a square where i can set the color.

Thanx

Share this post


Link to post
Share on other sites



akroon,

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

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

But this function color all the gui  :huh2: .

I want a gui like a checkbox where i can show just the color.

Share this post


Link to post
Share on other sites

akroon,

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

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

 

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0