Sign in to follow this  
Followers 0
sder33

Image Analysis

5 posts in this topic

Hello everyone.

I need to analyze the cursor icon and find out the colors of pixels with the specific coordinates.

I wander if there is a way to do this?

Will be grateful for any help.

Share this post


Link to post
Share on other sites



sder33,

Welcome to the AutoIt forum. :)

analyze the cursor icon

Not sure exactly what you want to do here. I would suggest looking at MouseGetCursor to see what icon is currently displayed, or MouseGetPos and GUIGetCursorInfo to find out where the mouse cursor is on the screen (which I think is what you mean).

find out the colors of pixels with the specific coordinates

Take a look at PixelGetColor.

Most of the answers are in the Help file - well worth a read before posting. ;)

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

Not sure exactly what you want to do here.

Melba23, you're right , question needs to be specified. I don't need to get the coordinates, I need to get the cursor icon and find out what icon the cursor has. I need to analyze the cursor within the game, and there is a special cursor that change its icon. PixelGetColor function ignores the cursor icon, if the icon is specific. Using _WinAPI_GetCursorInfo() is quite effective to get "needed" cursor, but I understood only how to export the cursor into image file using this function (module ScreenCapture.au3, function _ScreenCapture_Capture), I want to analyze the cursor handle it returns (_WinAPI_GetCursorInfo returns 5-length array as the result, 3rd element is the cursor handle) without exporting the icon into file. I need the colors of the cursor icon.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

With a little modification, you can use this technique: which can also capture all the pixels that the mouse cursor draws on the screen.

It's also a lot faster for getting multiple pixels at once.

Edit: Doesn't need modification. I built the functionality in the UDF. (Quite a while ago since I wrote it, 3 years already)

; #FUNCTION# ;===============================================================================
;
; Name...........: _PixelGetColor_CaptureRegion
; Description ...: Captures the user defined region and reads it to a memory DC.
; Syntax.........: _PixelGetColor_CaptureRegion($iPixelGetColor_MemoryContext, $iLeft = 0, $iTop = 0, $iRight = -1, $iBottom = -1, $fCursor = False)
; Parameters ....: $iPixelGetColor_MemoryContext    - The DC as returned by _PixelGetColor_CreateDC
;                   $iLeft      - Left side of the screen for use with the region
;                   $iTop       - Top side of the screen for use with the region
;                   $iRight     - Right side of the screen for use with the region
;                   $iBottom    - Bottom side of the screen for use with the region
;                   $iCursor    - If this is true, then the cursor is also read into memory
; Return values .: Success - Returns the handle to a region.
;                  Failure - 
; Author ........: Jos van Egmond
; Modified.......:
; Remarks .......:
; Related .......: _PixelGet_Color_CreateDC, _PixelGetcolor_GetPixel, _PixelGetColor_GetPixelRaw, _PixelGetColor_ReleaseRegion, _PixelGet_Color_ReleaseDC
; Example .......; No
;
; ;==========================================================================================

Just set $iCursor to True.

Edited by Manadar

Share this post


Link to post
Share on other sites

sder33,

I need to analyze the cursor within the game

Please read this and abide by the forum rules.

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
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0