Пример #1
0
        /// <summary>
        /// Ensures that the crop settings makes sense, ie, dont crop more than the the available image area.
        /// Also ensures that the crop values are positive.
        /// </summary>
        public CropSettings EnsureSanity(int ImageWidth, int ImageHeight)
        {
            CropSettings S = new CropSettings(_top, _bottom, _left, _right);

            if (S._right < 0)
            {
                S._right = 0;
            }

            if (S._left < 0)
            {
                S._left = 0;
            }

            if (S._top < 0)
            {
                S._top = 0;
            }

            if (S._bottom < 0)
            {
                S._bottom = 0;
            }

            if (S._right + S._left >= ImageWidth)
            {
                S._right = S._left = 0;
            }

            if (S._top + S._bottom >= ImageHeight)
            {
                S._top = S._bottom = 0;
            }

            return(S);
        }
Пример #2
0
    public VideoPlayer()
    {
      _cropSettings = ServiceRegistration.Get<IGeometryManager>().CropSettings;

      // EVR is available since Vista
      OperatingSystem osInfo = Environment.OSVersion;
      if (osInfo.Version.Major <= 5)
        throw new EnvironmentException("This video player can only run on Windows Vista or above");

      PlayerTitle = "VideoPlayer";
    }
Пример #3
0
    /// <summary>
    /// Ensures that the crop settings makes sense, ie, dont crop more than the the available image area.
    /// Also ensures that the crop values are positive.
    /// </summary>
    public CropSettings EnsureSanity(int ImageWidth, int ImageHeight)
    {
      CropSettings S = new CropSettings(_top, _bottom, _left, _right);

      if (S._right < 0)
        S._right = 0;

      if (S._left < 0)
        S._left = 0;

      if (S._top < 0)
        S._top = 0;

      if (S._bottom < 0)
        S._bottom = 0;

      if (S._right + S._left >= ImageWidth)
        S._right = S._left = 0;

      if (S._top + S._bottom >= ImageHeight)
        S._top = S._bottom = 0;

      return S;
    }