无法将 tiff 图像转换为位图(矩阵)

Can't convert tiff image to a bitmap (matrix)

函数 GetBitMapColorMatrix 应该解码 tiff 图像和 return 描述 tiff 图像的位图,但出于某种原因,我得到这个异常 -> System.PlatformNotSupportedException: 'System.Drawing is not supported on this platform'。任何帮助将不胜感激。

public Color[][] GetBitMapColorMatrix(string bitmapFilePath)
    {
        Bitmap b1 = new Bitmap(bitmapFilePath);

        int hight = b1.Height;
        int width = b1.Width;

        Color[][] colorMatrix = new Color[width][];
        for (int i = 0; i < width; i++)
        {
            colorMatrix[i] = new Color[hight];
            for (int j = 0; j < hight; j++)
            {
                colorMatrix[i][j] = b1.GetPixel(i, j);
            }
        }
        return colorMatrix;
    }

UWP 不使用完整的 .net 框架,因此 System.Drawing 中的 类 不可用。他们有一些 类 比如 BitmapPallette and BitmapImage in the System.Media.Imaging namespace that could be useful. I would also look at Win2D or SharpDX.