Byte To Image - CSharp System.Drawing

CSharp examples for System.Drawing:Image Effect

Description

Byte To Image

Demo Code


using System.IO;/*from   www. j a  v a  2s  .  c o  m*/
using System.Drawing;

public class Main{
        internal static Image ByteToImage(byte[] bytes)
        {
            try
            {
                var ms = new MemoryStream(bytes);
                return Image.FromStream(ms, true);
            }
            catch
            {
                return null;
            }
        }
}

Related Tutorials