C# Converting a 1bit BMP to version 3.0
-
12-12-2019 - |
Question
I currently have a C# project given to me that requires the converting any image to a 1bit Bitmap Image.
So far so good. The code is working perfectly well.
When the coverted file is sent to another colleague who needs it for a program that I can only guess was coded on the ark it throws this error:
resource file res\icon3.bmp is not in 3.00 format
How can I get my application to save in a 3.00 format? It's a bit of a head scratcher.
Solution
School boy error! Although the conversion code was fine and working perfectly the error was with the image.save! Even though I had a bitmap file - while analysing the header it was a PNG. Very strange. The code was this:
image.Save(newfilename);
After some headscratching this solved the problem:
n.Save(newfilename,ImageFormat.Bmp);
I hope this helps someone.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow