Beispiel #1
0
        public override EyesScreenshot GetSubScreenshot(Region region, bool throwIfClipped)
        {
            Region asIsSubScreenshotRegion = GetIntersectedRegion(region, CoordinatesTypeEnum.SCREENSHOT_AS_IS);

            if (asIsSubScreenshotRegion.IsSizeEmpty || (throwIfClipped && !asIsSubScreenshotRegion.Size.Equals(region.Size)))
            {
                throw new OutOfBoundsException($"Region [{region}] is out of screenshot bounds [{Image.Size}]");
            }

            Bitmap subScreenshotImage = BasicImageUtils.Crop(Image, asIsSubScreenshotRegion.ToRectangle());

            EyesImagesScreenshot result = new EyesImagesScreenshot(subScreenshotImage);

            return(result);
        }
 public override EyesScreenshot GetSubScreenshot(Region region, bool throwIfClipped)
 {
     return(this);
 }
 public override Region GetIntersectedRegion(Region region, CoordinatesTypeEnum originalCoordinatesType, CoordinatesTypeEnum resultCoordinatesType)
 {
     return(region);
 }