After spending a lot of time researching this on Google, I could not find an example of converting a Wbmp image to Png format in C # I downloaded some Wbmp images from the Internet and I view them using a binary editor.
Does anyone have an algorithm that will help me with this, or any code will help.
Things I know so far:
- The first byte is type * (0 for monochrome images)
- The second byte is called a "fixed header" and is 0
- The third byte is the image width in pixels *
- The fourth byte is the height of the image in pixels *
- Data byte placed in lines - one bit per pixel: If the line length is not divisible by 8, the line has a 0-complement to the byte boundary
I am completely lost, so any help would be appreciated
Some other codes:
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);
}
}
}
}
and
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);
}
}
Process:
. , Wbmp2Png. :
Wbmp2Png IMG_0001.wbmp IMG_0002.wbmp IMG_0003.wbmp
IMG_0001.wbmp, IMG_0002.wbmp IMG_0003.wbmp PNG.