Answers for "c# byte array to bitmap"

C#
3

bitmap to byte array c#

public static byte[] ImageToByteArray(Image img)
        {
            using (var stream = new MemoryStream())
            {
                img.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
                return stream.ToArray();
            }
        }
Posted by: Guest on June-28-2020
0

c# byte array to bitmap

Bitmap bmp;
using (var ms = new MemoryStream(imageData))
{
    bmp = new Bitmap(ms);
}
Posted by: Guest on March-18-2020
0

converting bitmap to byte array c#

public static byte[] ImageToByte(Image img)
{
    ImageConverter converter = new ImageConverter();
    return (byte[])converter.ConvertTo(img, typeof(byte[]));
}
Posted by: Guest on April-20-2021
0

converting bitmap to byte array c#

public static byte[] ImageToByte2(Image img)
{
    using (var stream = new MemoryStream())
    {
        img.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
        return stream.ToArray();
    }
}
Posted by: Guest on April-20-2021

C# Answers by Framework

Browse Popular Code Answers by Language