Jump to content

Image Analysis


sder33
 Share

Recommended Posts

  • Moderators

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

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

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.
Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Moderators

sder33,

I need to analyze the cursor within the game

Please read this and abide by the forum rules.

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

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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