Hi everybody.
Like the title says i want to take a screenshoot from a clipped camera. I’m trying and i’m just there to resolve it but i have some troubles
Here is my screenshot code
public Texture2D TakeScreenShot(Camera camera, Bounds bound)
{
#if UNITY_ANDROID
Texture2D snapShot = new Texture2D((int)camera.pixelWidth , (int)camera.pixelHeight, TextureFormat.RGB24, false );
snapShot.ReadPixels( new Rect( camera.pixelRect.xMin, camera.pixelRect.xMin-40, (int)camera.pixelWidth, (int)camera.pixelHeight), 0, 0, false );
snapShot.Apply();
return snapShot;
#endif
return new Texture2D(100,100);
}
And this is re result when i put the texture into a quad
That black part must not be. Seems that the Y is offset and the camera is not giving me the specific values.
Any idea?
Thanks!