public List <Pair> FindImageOnScreen(Rectangle area, WrapImg example, bool asd) { this.alpha = example.Alpha; var start = DateTime.Now; // DEBUG Bitmap example_image = (Bitmap)Bitmap.FromFile(example.Path); Bitmap image = new Bitmap(area.Width, area.Height); using (Graphics graph = Graphics.FromImage(image)) { graph.CopyFromScreen(area.X, area.Y, 0, 0, image.Size); } screen_time += DateTime.Now.Subtract(start).TotalSeconds; //DEBUG if (example.Diagonal) { return(FindAllDiagonalPairs(image, area, GetExampleColorList(example_image, example.Bias_Y, example.Bias_X))); } else { return(FindAllPairs(image, area, GetExampleColorList(example_image, example.Bias_Y))); } }
public List <Pair> FindImageOnScreen(Rectangle area, WrapImg example) { this.alpha = example.Alpha; Bitmap image = new Bitmap(area.Width, area.Height); Bitmap example_image = (Bitmap)Bitmap.FromFile(example.Path); using (Graphics graph = Graphics.FromImage(image)) { graph.CopyFromScreen(area.X, area.Y, 0, 0, image.Size); } if (example.Diagonal) { return(FindAllDiagonalPairs(image, area, GetExampleColorList(example_image, example.Bias_Y, example.Bias_X))); } else { return(FindAllPairs(image, area, GetExampleColorList(example_image, example.Bias_Y), example.Path)); } }