Unity Texture2D.ReadPixels() producing grey texture
<p>Here is my code:</p>

<pre class="lang-csharp prettyprint-override"><code>sigTex = new Texture2D ((int)dims.x, (int)dims.y);

sigTex.ReadPixels (new Rect (new Vector2(0.0f, Screen.height - bot) , dims), 0, 0);

byte[] pngBytes = sigTex.EncodeToPNG ();

System.IO.BinaryWriter bw= new System.IO.BinaryWriter(new System.IO.FileStream(filename, System.IO.FileMode.Create));
bw.Write (pngBytes, 0, pngBytes.Length);
bw.Close ();
</code></pre>

<p>The problem is that after this code I am left with a blank texture that is a uniform gray when I try to use it in GUI or view it in the inspector.
The strange thing is that the file produced is correct.</p>