static ScreenCheck ResolveCheck(ScreenCheck check, string dir) { var path = System.IO.Path.Combine(dir, check.Name + ".png"); if (!System.IO.File.Exists(path)) { return(check); } var bmp = (Bitmap)Bitmap.FromFile(path); return(new ScreenCheck(check.Name, check.Points .Select(point => new CheckPoint(point.Point.X, point.Point.Y, (uint)bmp.GetPixel(point.Point.X, point.Point.Y).ToArgb())) .ToArray() )); }
static ScreenCheck ResolveCheck(ScreenCheck check, string dir) { var path = System.IO.Path.Combine(dir, check.Name + ".png"); if (!System.IO.File.Exists(path)) return check; var bmp = (Bitmap)Bitmap.FromFile(path); return new ScreenCheck(check.Name, check.Points .Select(point => new CheckPoint(point.Point.X, point.Point.Y, (uint)bmp.GetPixel(point.Point.X, point.Point.Y).ToArgb())) .ToArray() ); }
static ScreenCheck[] ResolveChecks(ScreenCheck[] checks, string dir) { return checks.Select(check => ResolveCheck(check, dir)).ToArray(); }