Esempio n. 1
0
 public static PixelFormat ConvertPixelFormat(VideoPixelFormat pixelFormat)
 {
     switch (pixelFormat)
     {
         case VideoPixelFormat.Gray8:
             return PixelFormat.Format8bppIndexed;
         case VideoPixelFormat.BGR24:
             return PixelFormat.Format24bppRgb;
         case VideoPixelFormat.RGB24:
             throw new NotSupportedException();
         default:
             throw new ArgumentOutOfRangeException();
     }
 }
Esempio n. 2
0
        public static PixelFormat ConvertPixelFormat(VideoPixelFormat pixelFormat)
        {
            switch (pixelFormat)
            {
            case VideoPixelFormat.Gray8:
                return(PixelFormat.Format8bppIndexed);

            case VideoPixelFormat.BGR24:
                return(PixelFormat.Format24bppRgb);

            case VideoPixelFormat.RGB24:
                throw new NotSupportedException();

            default:
                throw new ArgumentOutOfRangeException();
            }
        }