The most basic function allows you to find the pixel in a given color - as PixelSearch - but instead of returning the first found, it returns the closest to a given point.
It can go much further:
- Search for 'spot' the closest (NxN square containing P pixels that meet the criteria of color mentioned)
- Maintains a list containing up to 1024 colors (search pixels with one color in this list)
- Manages up to 1024 exclusion rectangles. We can define precisely the search pattern that you want (with a rectangle from which you "substract" several "exclusion rectangles"). You can have up to 1024 exclusion rectangles.
- You can also set a 'shade variation' (same idea as with PixelSearch).
- Can work on several 'snapshots' (screen captures) in memory. It is possible to retain up to 1024 snapshots simultaneously (of course, each capture consumes memory, so only use the "slots" you really need).
- Works on full screen or specific window (HWND optionnal parameter) or part of it.
- Also includes functions to identify the changes between two SnapShots (minimum rectangle containing all changes + number of pixels that have changed). Useful to detect movement on the screen, object state changes...
- Fairly sophisticated tools provided for debugging are also included in the UDF. You can choose the type of logs you want, including the ability to view on screen the detected areas (most useful during development phasis) and record the transaction details in a log file.
- For even more performance, you can capture the content of a screen memory (SnapShot, takes about the same time as or PixelSearch PixelGetColor) then do all the research you want in this snapshots (very fast functions : nearly 1000 times as fast as the native PixelGetColor).
- [v1.4] : find the "best spot" - meaning the spot that has the best number of "right" colors.
- [v1.4] : now provided with a tool, FFShowPixels.exe, to find colors, manage color lists, show all occurences of them on the Captured Window, and... automatically generates AutoIt or C++ code.
- [v1.6] : Saves SnapShots on BitMaps (BMP and JPG supported)
- [v1.6] : Modifies SnapShots with "filters" (Keep only some colors or only pixels that have changes. All other pixels can be turned to black).
- [v1.7] : Can change pixels colors on SnapShots (SetPixel)
- [v1.7] : Can access the Raw pixel data of SnapShots (GetRawData)
- [v1.7] : Can draw back SnapShots on Screen.
- [v1.8] : Bug fixes. Deleted
- [v1.8.1] : Bug fixes (FastFind.au3).
- [v1.8.2] : Bug fixes (FastFind.au3).
- [v1.8.3] : Bug fixes (FastFind.au3). Deleted
- [v1.8.4] : Should now run on early XP and Windows 2000 OS.
- [v2.0] : Documentation file in english (FastFind.chm), several new functions and new feature on some old functions.
- [v2.1] : Bug fixes (removed those nasty errors in message boxes)
- [v2.2] : Bug fix
Included in the archive: both the 32 bits and 64 bits dll (written in Visual C++ 2010), the AutoIt Wrapper, a demonstration script and a tiny Benchmark script.
Here it is, your comments and suggestions are welcome.
Last Version : 2.2
FastFind 2_2.zip 186.78KB 3425 downloads
FastFind 2_2.zip 186.78KB 3425 downloads
FastFind 2_1.zip 186.33KB 1091 downloads
A new documentation file, in chm format (thanks to CeramicWeasel)
New functions :
DrawSnapShotXY (same as DrawSnapShot, with specific top-left position for drawing).
ComputeMeanValues (Gives mean Red, Green and Blue values of a SnapShot)
ApplyFilterOnSnapShot (apply a AND filter on each pixels in the SnapShot)
FFGetRawData (provide access to all pixel data)
ShadeVariation parameter added in the following functions :
FastFind 2_0.zip 184.05KB 2054 downloads
jan 5 2012: ShowPixel Link should work now FFShowPixels 1.7
-> bug fixes
FastFind 1_8_4.zip 145.49KB 1560 downloads
-> bug fix with client coordinates
-> Can change pixels colors on SnapShots (SetPixel)
-> Can access the Raw pixel data of SnapShots (GetRawData). Not that this feature is not allready wrapped into autoit: you have to do it with dllcall.
-> Can draw back SnapShots on Screen (DrawSnapShot).
-> New function to duplicate a SnapShot (DuplicateSnapShot)
FastFind 1_7.zip 149.28KB 1043 downloads
FFShowPixels + FastFind complete 1.7 package : FFShowPixels 1.7
-> bug fix (restriction rectangles + FFColorCount)
-> New functions to export captures into BMP or JPEG Files
-> New functions to create SnapShots with changes or selected colors from a previous SnapShot(FFKeepChanges & FFKeepColors).
FFShowPixels1_6 wo FFShowPixels.zip 142.68KB 646 downloads
-> FFGetPixel bug fix.
FastFind1_5.zip 132.45KB 562 downloads
(Update) Version 1.4
-> A new optional parameter in SetHWnd : You can now choose to take either the full Window or only the Client area of the window.
-> Several bug fixes (more reliable and consistent)
-> A new search fonction : FFBestSpot. It will find the spot that contains the most "good" pixels.
-> A new tool - ShowPixels.exe - will allow you to easily manage list of colors (find them on the screen, make stats...) and automatically generate AutoIt or C++ code from them.
Unfortunately, the zip is too big to include ShowPixel.exe in it. So if you want this tool, just ask with pm or mail.
(Update) Version 1.3
-> comments in demo scripts now in english
-> Some minor bug fixed
-> now both 32 bits and 64 bits dll are provided
-> Several function calls are now more simple to use : the x1,y1,x2,y2 limits of the area for search functions are now optional. Default values means full window (or screen))
** Warning ** I've changed the order of the parameters in some fonctions, to make them easier to use. So if you use any of the 3 following function, you will need to reorder the parameters if you want to update to the version 1.3 of FastFind.
Func FFNearestPixel($PosX, $PosY, $Color, $Left=0, $Top=0, $Right=0, $Bottom=0, $ForceNewSnap=true, $NoSnapShot=$FFLastSnap, $WindowHandle=-1)
Func FFNearestSpot($SizeSearch, $NbPixel, $PosX, $PosY, $Color, $ShadeVariation=0, $Left=0, $Top=0, $Right=0, $Bottom=0, $ForceNewSnap=true, $NoSnapShot=$FFLastSnap, $WindowHandle=-1)
Func FFColorCount($ColorToCount, $ShadeVariation=0, $Left=0, $Top=0, $Right=0, $Bottom=0, $ForceNewSnap=true, $NoSnapShot=$FFLastSnap, $WindowHandle=-1)
(Update) Version 1.2
I hope these library will prove useful. Please tell me how you use it and how you like it.
Edited by FastFrench, 23 April 2013 - 10:56 AM.