Change Byte To Img - CSharp System

CSharp examples for System:Math Number

Description

Change Byte To Img

Demo Code


using System.Drawing.Imaging;
using System.Drawing;
using System.IO;/*from w ww .ja va 2  s .c  om*/
using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;

public class Main{

        public static Image ChangeByteToImg(byte[] bytImage)
        {
            if (bytImage != null)
            {
                MemoryStream ms = new MemoryStream(bytImage);
                //ms.Position = 0;
                Image img = Image.FromStream(ms);
                //ms.Close();
                return img;
            }
            return null;
        }
}

Related Tutorials