Как конвертировать Wbmp в Png?

Потратив много времени на изучение этого вопроса в Google, я не смог найти пример преобразования изображения Wbmp в формат Png в C # Я загрузил некоторые изображения Wbmp из Интернета, и я просматриваю их с помощью двоичного редактора.

У кого-нибудь есть алгоритм, который поможет мне в этом, или любой код также поможет.

Things I know so far:

First byte is type* (0 for monochrome images) Second byte is called a “fixed-header” and is 0 Third byte is the width of the image in pixels* Fourth byte is the height of the image in pixels* Data bytes arranged in rows – one bit per pixel: Where the row length is not divisible by 8, the row is 0-padded to the byte boundary

Я полностью потерян, поэтому любая помощь будет оценена

Некоторые из другого кода:

using System.Drawing;
using System.IO;

class GetPixel
{
   public static void Main(string[] args)
   {
      foreach ( string s in args )
      {
         if (File.Exists(s))
         {
            var image = new Bitmap(s);
            Color p = image.GetPixel(0, 0);
            System.Console.WriteLine("R: {0} G: {1} B: {2}", p.R, p.G, p.B);
         }
      }
   }
}

А также

class ConfigChecker
{
   public static void Main()
   {
      string drink = "Nothing";
      try
      {
         System.Configuration.AppSettingsReader configurationAppSettings 
            = new System.Configuration.AppSettingsReader();
         drink = ((string)(configurationAppSettings.GetValue("Drink", typeof(string))));
      }
      catch ( System.Exception )
      {
      }
      System.Console.WriteLine("Drink: " + drink);
   } // Main
} // class ConfigChecker

Процесс :

Did research on Wbmp

Open up X.wbmp to check details first

Work out how you find the width and height of the WBMP file (so that you can later write the code). Note that the simplest way to convert a collection of length bytes (once the MSB is cleared) is to treat the entity as base-128.

Look at sample code I updated.

I am trying to create an empty Bitmap object and set its width and height to what we worked out in (3)

For every bit of data, will try and do a SetPixel on the Bitmap object created.

Padded 0s when the WBMP width is not a multiple of 8.

Save Bitmap using the Save() method.

Пример использования приложения. Предполагается, что приложение называется Wbmp2Png. В командной строке:

Wbmp2Png IMG_0001.wbmp IMG_0002.wbmp IMG_0003.wbmp

Приложение преобразует каждый из файлов IMG_0001.wbmp, IMG_0002.wbmp и IMG_0003.wbmp в файлы PNG.

Ответы на вопрос(2)

Ваш ответ на вопрос