Jump to content
major_lee

_PixelGetColorLog($pixel)

Recommended Posts

It logs the info for pixels, used with the mouse in example
I made for capability extending AutoIt v3 Window Info. Now with this I can see how often the color has been.  I made because i was getting interference (from Custom Mouse Curser Animation) with AutoIt v3 Window Info. Now I can see the most common color.

I am no expert at this so maybe others know of a better way of this? I would love to hear.

 

#include <AutoItConstants.au3>
#include <MsgBoxConstants.au3>
#include <Array.au3> ; Required for _ArrayDisplay.

HotKeySet("{END}","quit")
local $i,$j =0
Local $pixelLogg[0][2]
$sFill = "pixel" &"|"& "#####"
_ArrayAdd($pixelLogg, $sFill)

ToolTip("BOOT",0,0)
Sleep(2000)

Func quit()
    _ArrayDisplay($pixelLogg)
    Exit
EndFunc

Func _PixelGetColorLog($pixel) ;; to extend ??
    Local $iRows = UBound($pixelLogg, $UBOUND_ROWS) ; Total number of rows. In this example it will be 10.
    Local $iCols = UBound($pixelLogg, $UBOUND_COLUMNS) ; Total number of columns. In this example it will be 20.
    Local $iDimension = UBound($pixelLogg, $UBOUND_DIMENSIONS) ; The dimension of the array e.g. 1/2/3 dimensional.
    $pixel = Hex($pixel,6)
    ToolTip($pixel,0,0)
    For $i = 0 To $iRows - 1
        For $j = 0 To $iCols - 1
            ConsoleWrite("["&$i&"],["&$j&"]"&$pixelLogg[$i][$j] &@CRLF)
            if($pixelLogg[$i][$j] == $pixel) Then
            ConsoleWrite("++" &@CRLF)
            $pixelLogg[$i][$j+1] = $pixelLogg[$i][$j+1] +1
            ExitLoop
            ExitLoop
            EndIf

            If ($i == $iRows-1 ) Then
            ConsoleWrite("_ArrayAdd" &@CRLF)
                $sFill = $pixel &"|"& 1
                _ArrayAdd($pixelLogg, $sFill)
            ExitLoop
            ExitLoop
            EndIf
        Next
    Next
EndFunc

While 1
$MousePos = MouseGetPos()
$pixelMouse = PixelGetColor($MousePos[0],$MousePos[1])
_PixelGetColorLog($pixelMouse)
Sleep(100)
WEnd

 

Share this post


Link to post
Share on other sites

major_lee,

And just what is the point of this script? What function does it fill? Why is it needed?

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

 

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

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...