public override RectangleF GetZoomRect(float animationProgress, Size imageSize, Size outputSize) { bool isLandscape = IsLandscape(imageSize, outputSize); Point startEndPanPoints = isLandscape ? KenBurnsEffects.LANDSCAPE_PAN_SPOTS[_panPointsIndex] : KenBurnsEffects.PORTRAIT_PAN_SPOTS[_panPointsIndex]; PointF panStartPoint = KenBurnsEffects.SPOT_POINTS[startEndPanPoints.X]; PointF panEndPoint = KenBurnsEffects.SPOT_POINTS[startEndPanPoints.Y]; return(KenBurnsEffects.GetKenBurnsPanRectangle(_zoomFactor, panStartPoint.X + (panEndPoint.X - panStartPoint.X) * animationProgress, panStartPoint.Y + (panEndPoint.Y - panStartPoint.Y) * animationProgress, imageSize, outputSize)); }
public override RectangleF GetZoomRect(float animationProgress, Size imageSize, Size outputSize) { bool isLandscape = IsLandscape(imageSize, outputSize); int zoomCenterPoint = 0; switch (_zoomCenterClass) { case ZoomCenterClass.TopLeft: zoomCenterPoint = isLandscape ? 8 : 2; break; case ZoomCenterClass.Middle: zoomCenterPoint = 0; break; case ZoomCenterClass.BottomRight: zoomCenterPoint = isLandscape ? 4 : 6; break; } return(KenBurnsEffects.GetKenBurnsZoomRectangle(_startZoomFactor + (_endZoomFactor - _startZoomFactor) * animationProgress, zoomCenterPoint, imageSize, outputSize)); }