Class ScreenshotUtility
public static class ScreenshotUtility
- Inheritance
-
ScreenshotUtility
- Inherited Members
Methods
CaptureActiveRenderTexture(int, int, TextureFormat)
public static Texture2D CaptureActiveRenderTexture(int width, int height, TextureFormat format = 4)
Parameters
widthintheightintformatTextureFormat
Returns
CaptureRawScreenshot(Camera, Vector2, int, RenderTextureFormat)
Capture raw screenshot from renderer to a new Texture2D.
public static Texture2D CaptureRawScreenshot(Camera camera, Vector2 size, int depthBuffer = 24, RenderTextureFormat renderTextureFormat = 0)
Parameters
Returns
CaptureRawScreenshotAsync(Camera, Vector2, int, RenderTextureFormat, int, Action<Texture2D>, int)
Capture raw screenshot from renderer to a new Texture2D in async.
public static UniTask CaptureRawScreenshotAsync(Camera camera, Vector2 size, int depthBuffer = 24, RenderTextureFormat renderTextureFormat = 0, int delayFrames = 1, Action<Texture2D> onComplete = null, int maxWarmupFrames = 32)
Parameters
cameraCamerasizeVector2depthBufferintrenderTextureFormatRenderTextureFormatdelayFramesintonCompleteAction<Texture2D>maxWarmupFramesint
Returns
- UniTask
CaptureScreenShotFromScreen()
Capture screenshot to a new Texture2D. Need be called at the end of frame.
public static Texture2D CaptureScreenShotFromScreen()
Returns
CaptureScreenshot(ScreenshotRequest)
public static ScreenshotUtility.ScreenshotHandler CaptureScreenshot(ScreenshotRequest request)
Parameters
requestScreenshotRequest
Returns
CaptureScreenshotAsync(ScreenshotRequest)
public static UniTask<ScreenshotUtility.ScreenshotHandler> CaptureScreenshotAsync(ScreenshotRequest request)
Parameters
requestScreenshotRequest
Returns
- UniTask<ScreenshotUtility.ScreenshotHandler>
CaptureScreenshotAsync(Action<Texture2D>)
Capture screenshot to a new Texture2D in async. Need be called at the end of frame.
public static UniTask CaptureScreenshotAsync(Action<Texture2D> onComplete)
Parameters
Returns
- UniTask
GetTextureFormat(RenderTextureFormat)
public static TextureFormat GetTextureFormat(RenderTextureFormat renderTextureFormat)
Parameters
renderTextureFormatRenderTextureFormat
Returns
ToTexture2D(RenderTexture)
public static Texture2D ToTexture2D(this RenderTexture renderTexture)
Parameters
renderTextureRenderTexture
Returns
ToTexture2DAsync(RenderTexture, Action<Texture2D>)
public static void ToTexture2DAsync(this RenderTexture renderTexture, Action<Texture2D> callback)