コード例 #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);
        }
コード例 #2
0
 public override EyesScreenshot GetSubScreenshot(Region region, bool throwIfClipped)
 {
     return(this);
 }
コード例 #3
0
 public override Region GetIntersectedRegion(Region region, CoordinatesTypeEnum originalCoordinatesType, CoordinatesTypeEnum resultCoordinatesType)
 {
     return(region);
 }