Ejemplo n.º 1
0
    public override RectangleF GetZoomRect(float animationProgress, Size imageSize, Size outputSize)
    {
      bool isLandscape = IsLandscape(imageSize.ToSize2F(), outputSize.ToSize2F());
      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.ToSize2F(), outputSize.ToSize2F());
    }
Ejemplo n.º 2
0
        public override RectangleF GetZoomRect(float animationProgress, Size imageSize, Size outputSize)
        {
            bool   isLandscape       = IsLandscape(imageSize.ToSize2F(), outputSize.ToSize2F());
            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.ToSize2F(), outputSize.ToSize2F()));
        }
        public override RectangleF GetZoomRect(float animationProgress, Size imageSize, Size outputSize)
        {
            bool isLandscape     = IsLandscape(imageSize.ToSize2F(), outputSize.ToSize2F());
            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.ToSize2F(), outputSize.ToSize2F()));
        }
Ejemplo n.º 4
0
 public override RectangleF GetZoomRect(float animationProgress, Size imageSize, Size outputSize)
 {
   bool isLandscape = IsLandscape(imageSize.ToSize2F(), outputSize.ToSize2F());
   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.ToSize2F(), outputSize.ToSize2F());
 }