Jump to content
Sign in to follow this  
danzar

C# Auto3. PixelSearch

Recommended Posts

danzar

Hi i was woundering if somone can give me hint how to get the X, and Y varables from >pixelsearch() into a C# varable?

example

XY[] = Pixelsearch(0,0,100,100,0x123456,2,2);
          MoveMouse(XY[0],XY[1],1);

How do i make that work in C#

Share this post


Link to post
Share on other sites
BobK

There's probably an easier way to do it, but this works:

CODE
private void button1_Click(object sender, EventArgs e)

{

AutoItX3 au3 = new AutoItX3();

Int32[] pt = new Int32[2];

int color;

try

{

color = Convert.ToInt32(textBox1.Text);

Array.Copy((System.Object[])(au3.PixelSearch(0, 0, 100, 100, color, 2, 2)), pt, 2);

MessageBox.Show(pt[0].ToString() + " " + pt[1].ToString());

}

catch

{

MessageBox.Show("Color not found");

}

}

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.