Jump to content

Can Image Search have a Shade Variation


 Share

Recommended Posts

In the ImageSearch.au3 I set the tolerance to 255 as a test to see if it would pick anything up but it didn't.

Func _ImageSearch($findImage,$resultPosition, ByRef $x, ByRef $y,$tolerance=255, $HBMP=0)
   return _ImageSearchArea($findImage,$resultPosition,0,0,@DesktopWidth,@DesktopHeight,$x,$y,$tolerance,$HBMP)
EndFunc

This is the running script I'm using for the first image. The image specified below is the dark green image. The Lighter green image is sitting on the desktop.

#include <WinAPI.au3>
#include <ImageSearch.au3>
#include <GDIPlus.au3>
#include <MsgBoxConstants.au3>

$fileA = @ScriptDir & "\pics\Green.png"
_GDIPlus_Startup()

$hImageA = _GDIPlus_ImageLoadFromFile($fileA)
$hBitmapA = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImageA)

$x = 0
$y = 0

$result = _ImageSearch($hBitmapA, 1, $x, $y, 20, 0)

If $result > 0 Then
    MsgBox($MB_SYSTEMMODAL, "Test", "Color was found", 1)
EndIf

 

Edited by aa2zz6
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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