
The following code examples show how you can find and compare images within controls.
The function searches an image loaded from a file on the screen within the control rectangle.
toolStrip.FindImage("Example.bmp", out foundLocation);
The function searches an image on the screen within the control rectangle. The positions are given in screen coordinates that are relative to the upper-left corner of the screen.
toolStrip.Findimage(location, size, out foundLocation);
You can compare images in three different ways:
toolStrip.CompareImage(toolStrip2);
The function compares the image of the control with an other image on the screen.
The positions are given in screen coordinates that are relative to the upper-left corner of the screen.
toolStrip.CompareImage(location, size, offset);
Compares the image of the control with another image loaded from a file.
The offset is given in screen coordinates that are relative to the upper-left corner of the control.
toolStrip.CompareImage("Example.bmp", offset);
Announcements