我有一个项目将图像格式文件转换为图标文件.但是,在转换图像后,图像的颜色会发生变化.
这是我的代码
Bitmap theBitmap = new Bitmap(theImage, new Size(width, height));
IntPtr Hicon = theBitmap.GetHicon();// Get an Hicon for myBitmap.
Icon newIcon = Icon.FromHandle(Hicon);// Create a new icon from the handle.
FileStream fs = new FileStream(@"c:\Icon\" + filename + ".ico", FileMode.OpenOrCreate);//Write Icon to File Stream
Run Code Online (Sandbox Code Playgroud)

谁知道怎么解决这个问题?