UtilAForgeMatchImage(IntPtr, Bitmap, Single) Method

Matches a part of an image in the specified window, and returns the relative top-left corner coordinates of any matched image and their similarity percent.

Definition

Namespace: DevCase.ThirdParty.AForge
Assembly: DevCase.net48.ThirdParty.AForge (in DevCase.net48.ThirdParty.AForge.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static TemplateMatch[] MatchImage(
	IntPtr hWnd,
	Bitmap findImage,
	float similarity
)

Parameters

hWnd  IntPtr
A handle to the source window.
findImage  Bitmap
The image to find.
similarity  Single
The similarity percentage threshold to compare the image.

A value of 100 means find a 100% identical image.

Note: High percentage values with images of big resolutions could take several minutes to accomplish.

Return Value

TemplateMatch
An Array of TemplateMatch that contains the relative top-left corner coordinates of any matched image and their similarity percent.

Remarks

Note: Some functionalities of this assembly may require to install one or all of the listed NuGet packages:

https://www.nuget.org/packages/AForge/

https://www.nuget.org/packages/AForge.Imaging/

https://www.nuget.org/packages/AForge.Math/

Example

This is a code example.
C#
No code example is currently available or this language may not be supported.

See Also