← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #672323]: Sikuli4Net: how to use targetOffset()

 

Question #672323 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/672323

    Status: Answered => Solved

Kenneth.P confirmed that the question is solved:
Just a quick followup.

I figured it out some time ago. So i just want to share incase anyone
else had the same problem.

So i switched from Sikuli4Net to SikuliSharp

Below is an example of how to set offset in SikuliSharp (C#)

private void button1_Click(object sender, EventArgs e)
        {
            using (var session = Sikuli.CreateSession())
            {
                SikuliSharp.Point offsetLogin = new SikuliSharp.Point(50, 0); // Adds an offset (x, y) from the center of the picture.
                SikuliSharp.Point offsetLogin2 = new SikuliSharp.Point(0, +200, 0); // Adds an offset (x + 200, y) With this you can set the offset outside the picture borders.

                IPattern loginImage =
Patterns.FromFile(@"C:\Users\Elliot\Desktop\Sikuli
Images\UserName.PNG");

                while (!session.Exists(loginImage))
                {
                    Thread.Sleep(500);
                }

                session.Click(loginImage, offsetLogin);
                session.Type("Testing@xxxxxxxxx");
                session.Dispose();
            }
        }

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.