Modifier

Partager via


Texture2DExtensions.CaptureScreenRegion(Int32, Int32, Int32, Int32) Method

Definition

Captures a region of the screen and returns it as a texture.

public:
 static UnityEngine::Texture2D ^ CaptureScreenRegion(int x, int y, int width, int height);
public static UnityEngine.Texture2D CaptureScreenRegion (int x, int y, int width, int height);
static member CaptureScreenRegion : int * int * int * int -> UnityEngine.Texture2D
Public Function CaptureScreenRegion (x As Integer, y As Integer, width As Integer, height As Integer) As Texture2D

Parameters

x
Int32

x position of the screen to capture from (bottom-left)

y
Int32

y position of the screen to capture from (bottom-left)

width
Int32

width of the screen area to capture

height
Int32

height of the screen area to capture

Returns

UnityEngine.Texture2D

A Texture2D containing pixels from the region of the screen specified

Remarks

You should call this in OnPostRender.

Applies to