Ejemplo n.º 1
0
        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()
                                   ));
        }
Ejemplo n.º 2
0
        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()
             );

        }
Ejemplo n.º 3
0
 static ScreenCheck[] ResolveChecks(ScreenCheck[] checks, string dir)
 {
     return checks.Select(check => ResolveCheck(check, dir)).ToArray();
 }