I need to take screen shoot of specific area of my UI, so I need a Rect to use in Texture2D.ReadPixel()
.
I tried to put an Image on the RectTranform and a script like this:
Rect data=Image.GetPixelAdjustedRect();
//then draw it with
void OnGUI()
{
GUI.Box(data,"test");
}
The result :(the white box is what I’m trying to capture, you can see the darker GUI draw on the upper left)
Im also tried to use RectTranform.GetWorldCorners()
and Camera.WorldToScreenPoint() to create a Rect but no luck even it seem closer :((
Please help!