Exemple #1
0
        private static int GetBpp(OpenKh.Imaging.PixelFormat pixelFormat)
        {
            switch (pixelFormat)
            {
            case OpenKh.Imaging.PixelFormat.Indexed4: return(4);

            case OpenKh.Imaging.PixelFormat.Indexed8: return(8);

            default:
                throw new ArgumentException($"Pixel format {pixelFormat} not supported", nameof(pixelFormat));
            }
        }
Exemple #2
0
        private static System.Windows.Media.PixelFormat GetPixelFormat(OpenKh.Imaging.PixelFormat pixelFormat)
        {
            switch (pixelFormat)
            {
            case OpenKh.Imaging.PixelFormat.Indexed4:
                return(PixelFormats.Indexed4);

            case OpenKh.Imaging.PixelFormat.Indexed8:
                return(PixelFormats.Indexed8);

            default:
                throw new ArgumentException($"Pixel format {pixelFormat} not supported", nameof(pixelFormat));
            }
        }