输入图像在加载过程中丢失了其像素格式。c#

输入图像在加载过程中丢失了其像素格式。c#,c#,bitmap,pixelformat,C#,Bitmap,Pixelformat,我想将我的资源中的图像加载到位图,并保存其像素格式。输入图像是一个具有8位像素图像深度的.bmp文件。代码如下: Bitmap inputImage = new Bitmap(Test.Resources.sourceImage); 当我调试程序并检查sourceImage的属性时,它的PixelFormat是PixelFormat.Format8Bppined。 但是在这个变量赋值之后,inputImage的像素格式是Format32bppArgb 你知道问题出在哪里吗 var source

我想将我的资源中的图像加载到位图,并保存其像素格式。输入图像是一个具有8位像素图像深度的.bmp文件。代码如下:

Bitmap inputImage = new Bitmap(Test.Resources.sourceImage);
当我调试程序并检查sourceImage的属性时,它的PixelFormat是
PixelFormat.Format8Bppined
。 但是在这个变量赋值之后,inputImage的像素格式是
Format32bppArgb

你知道问题出在哪里吗

var source = Test.Resources.sourceImage;
Bitmap inputImage = source.Clone(new Rectangle(Point.Empty, source.Size), source.PixelFormat);