Hi I wanna convert binary array to bitmap and show image in a `picturebox`. I wrote the following code but I got exception that says that the parameter is not valid .

```
  public static Bitmap ByteToImage(byte[] blob)
    {
        MemoryStream mStream = new MemoryStream();
        byte[] pData = blob;
        mStream.Write(pData, 0, Convert.ToInt32(pData.Length));
        Bitmap bm = new Bitmap(mStream);
        mStream.Dispose();
        return bm;

    }

```