this is my cod and i receive " Parameter is not valid. "error in system.drawing.bitmap please help me;

   localhost.WebService obj = new localhost.WebService();

    byte[] data = obj.showImage(2);

    Int32 offset = 78;

    System.IO.MemoryStream mstream = new System.IO.MemoryStream();


    mstream.Write(data, offset, data.Length - offset);

    System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(mstream);

    bmp.Save(Server.MapPath("empimg.jpeg"), System.Drawing.Imaging.ImageFormat.Jpeg);

    mstream.Close();

    Image1.ImageUrl = Server.MapPath("empimg.jpeg"); 

Related posts

Recent Viewed