I have form in which background is transparent. I have a button on the form. When I click the button, screenshot of the transparent area is taken and the screenshot is analyzed for a certain reference-image, and if the image is found, a rectangle should be drawn around the reference-image. For now nothing happens when I press the button. I'm using BotSuite Dll, provided here: http://www.botsuite.net/. I My code for the button click is as follows:
private void button1_Click(object sender, EventArgs e)
{
Invalidate();
//take screenshot of transparent form area
Bitmap CapturedScreen = ScreenShot.Create((this.Left + 8), (this.Top + 30), 780, 415);
ImageData refpic = new ImageData("pallo.bmp");
ImageData source = new ImageData(CapturedScreen);
Graphics graphics = this.CreateGraphics();
Pen p = new Pen(Color.Black, 1);
graphics.DrawRectangle(p, Template.Image(source, refpic, 100));
Refresh();
}