Used for storing a single image size used throughout the application
Inheritance: IDisposable
Ejemplo n.º 1
0
        /// <summary>
        /// Maps a new size to picture sizes collection
        /// </summary>
        /// <param name="pictureSizes"></param>
        /// <param name="size"></param>
        public static void MapSize(this IList<PictureSize> pictureSizes, PictureSize size)
        {
            if(pictureSizes == null)
                throw new mobSocialException("Can't map size to null collection");

            pictureSizes.Add(size);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Overrides existing size with name as provided size with new values. Adds if the size doesn't exist
 /// </summary>
 public static void UpdateOrInsertSize(this IList<PictureSize> pictureSizes, PictureSize size)
 {
     if (pictureSizes == null)
         throw new mobSocialException("Can't map size to null collection");
     var pictureSize = pictureSizes.FirstOrDefault(x => x.Name == size.Name);
     if (pictureSize == null)
         MapSize(pictureSizes, size);
     else
     {
         //assign new values
         pictureSize.Width = size.Width;
         pictureSize.Height = size.Height;
         //clear resource
         size.Dispose();
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Overrides existing size with name as provided size with new values. Adds if the size doesn't exist
        /// </summary>
        public static void UpdateOrInsertSize(this IList <PictureSize> pictureSizes, PictureSize size)
        {
            if (pictureSizes == null)
            {
                throw new mobSocialException("Can't map size to null collection");
            }
            var pictureSize = pictureSizes.FirstOrDefault(x => x.Name == size.Name);

            if (pictureSize == null)
            {
                MapSize(pictureSizes, size);
            }
            else
            {
                //assign new values
                pictureSize.Width  = size.Width;
                pictureSize.Height = size.Height;
                //clear resource
                size.Dispose();
            }
        }
 public void WriteVideoThumbnailPicture(string videoFilePath, string imageFilePath, PictureSize size, float? frameTime)
 {
     var ffmpeg = new FFMpegConverter();
     ffmpeg.GetVideoThumbnail(videoFilePath, imageFilePath, frameTime);
 }
 public void WriteVideoThumbnailPicture(string videoFilePath, string imageFilePath, PictureSize size)
 {
     WriteVideoThumbnailPicture(videoFilePath, imageFilePath, size, null);
 }