'赤赤赤赤 '青青白白 '緑緑緑白 Dim pixAry As Integer(,) = New Integer(,) { _ {&H0000FF,&H0000FF,&H0000FF,&H0000FF} _ , {&HFF0000,&HFF0000,&HFFFFFF,&HFFFFFF} _ , {&H00FF00,&H00FF00,&H00FF00,&HFFFFFF} _ }
'オブジェクトウインドウ内を検索して、 '色を示す2次元配列とマッチしたオブジェクトウインドウ座標値をPoint構造体で返します Dim instance As ClientHwnd Dim pixAry As Integer(,) Dim returnValue As System.Drawing.Point 'Overloads returnValue = instance.ImageSearchClient(pixAry)
'オブジェクトウインドウ内の指定した四方の幅を除く範囲を検索して '色を示す2次元配列とマッチしたオブジェクトウインドウ座標値をPoint構造体で返します Dim instance As ClientHwnd Dim pixAry As Integer(,) Dim offsetLeft As Integer Dim offsetTop As Integer Dim offsetRight As Integer Dim offsetBottom As Integer Dim returnValue As System.Drawing.Point 'Overloads returnValue _ = instance.ImageSearchClient(pixAry, offsetLeft, offsetTop, offsetRight, offsetBottom)
'ClientHwndクラス ImageSearchClientメソッド Imports System.Windows.Forms Imports System.Drawing Public Class AddIn Private chw As ClientHwnd Public Sub New() chw = New ClientHwnd() End Sub Public Sub AddIn_Start() Dim pixAry As Integer(,) = New Integer(,) { _ {&H0000FF,&H0000FF,&H0000FF,&H0000FF} _ , {&HFF0000,&HFF0000,&HFFFFFF,&HFFFFFF} _ , {&H00FF00,&H00FF00,&H00FF00,&HFFFFFF} _ } Dim result As Point = chw.ImageSearchClient(pixAry) If result.X <> -1 Then MessageBox.Show("画像位置X:" & result.X.ToString & " Y:" & result.Y.ToString) Else MessageBox.Show("画像は見つかりませんでした") End If End Sub End Class
'ClientHwndクラス ImageSearchClientメソッド Imports System.Windows.Forms Imports System.Drawing Public Class AddIn Private chw As ClientHwnd Public Sub New() chw = New ClientHwnd() End Sub Public Sub AddIn_Start() Dim pixAry As Integer(,) = New Integer(,) { _ {&H0000FF,&H0000FF,&H0000FF,&H0000FF} _ , {&HFF0000,&HFF0000,&HFFFFFF,&HFFFFFF} _ , {&H00FF00,&H00FF00,&H00FF00,&HFFFFFF} _ } Dim result As Point = chw.ImageSearchClient(pixAry,150,200,150,80) If result.X <> -1 Then MessageBox.Show("画像位置X:" & result.X.ToString & " Y:" & result.Y.ToString) Else MessageBox.Show("画像は見つかりませんでした") End If End Sub End Class
このページのQRコード
便利ウェブサイト
便利 Android アプリ
便利 iOS(iPhone,iPad) アプリ