using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace Amozeshgah
{
    class clsPic
    {
        public static byte[] ImageToByteArray(Image img)
        {
            System.IO.MemoryStream ms = new System.IO.MemoryStream();
            img.Save(ms, img.RawFormat);
            byte[] Buffer = ms.GetBuffer();
            ms.Close();
            return Buffer;
        }
    }
}
