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(); } }
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(); } }