sder33 Posted February 2, 2011 Share Posted February 2, 2011 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. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 2, 2011 Moderators Share Posted February 2, 2011 sder33,Welcome to the AutoIt forum. analyze the cursor iconNot 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 coordinatesTake 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 Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
sder33 Posted February 3, 2011 Author Share Posted February 3, 2011 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 More sharing options...
jvanegmond Posted February 3, 2011 Share Posted February 3, 2011 (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 February 3, 2011 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 3, 2011 Moderators Share Posted February 3, 2011 sder33,I need to analyze the cursor within the gamePlease 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 Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts