Reference API Roblox

Engine API

Website

Related

Reference API Roblox

StudioScreenshotCapture

Represents a single screenshot captured from Studio, exposing the resulting image buffer and the parameters the capture was taken with.

This class is not replicated. Its interface does not cross the network boundary.
This class is not creatable. Instances of this class cannot be created with Instance.new.
Tags: [NotCreatable, NotReplicated]

Member index 9

HistoryMember
714BufferFormat: StudioCaptureScreenshotFormat
714BufferStatus: StudioCaptureBufferStatus
714OriginalSize: Vector2
714Position: Vector2
714Resolution: Vector2
714UICaptureMode: UICaptureMode
714GetBuffer(): buffer
714GetErrors(): Array
714ScaleAsync(strategy: ResamplerMode, newSize: Vector2): StudioScreenshotCapture
inherited from Instance
553Archivable: bool
670Capabilities: SecurityCapabilities
723IsInSandbox: bool
553Name: string
553Parent: Instance
702PredictionMode: PredictionMode
670Sandboxed: bool
680UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
707GetDescendants(): Instances
486GetFullName(): string
706GetStyled(name: string, selector: string?): Variant
657GetStyledPropertyChangedSignal(property: string): RBXScriptSignal
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
664IsPropertyModified(property: string): bool
698QueryDescendants(selector: string): Instances
573Remove(): null
576RemoveTag(tag: string): null
664ResetPropertyToDefault(property: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
657StyledPropertiesChanged()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Description

Studio-only capture result that requires plugin security — not available in published experiences. Produced by CaptureScreenshot() and CapturePluginGui(). It holds the encoded image data together with the region and format used for the capture, and reports progress through BufferStatus.

The image is populated asynchronously. BufferStatus defaults to StudioCaptureBufferStatus.NotStarted, becomes StudioCaptureBufferStatus.Pending while capturing and encoding, StudioCaptureBufferStatus.Ready once the image is available, or StudioCaptureBufferStatus.Error if capture failed. Retrieve the image with GetBuffer(), read failure details with GetErrors(), and produce a resized copy with ScaleAsync().

History 10

Members 9

BufferFormat

TypeDefault
StudioCaptureScreenshotFormatRGBA8

The StudioCaptureScreenshotFormat the capture's image data is encoded in, and therefore the format of the buffer returned by GetBuffer(). Defaults to StudioCaptureScreenshotFormat.RGBA8, in which the buffer holds four bytes (red, green, blue, alpha) per pixel; when StudioCaptureScreenshotFormat.PNG, the buffer holds a PNG-encoded image. This property is read-only and reflects the Format requested when the capture was created.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 1

Tags: [ReadOnly, NotReplicated]

BufferStatus

TypeDefault
StudioCaptureBufferStatusNotStarted

The StudioCaptureBufferStatus describing where the capture is in its lifecycle. Defaults to StudioCaptureBufferStatus.NotStarted, is set to StudioCaptureBufferStatus.Pending while the image is being captured and encoded, becomes StudioCaptureBufferStatus.Ready once the image data is available, and becomes StudioCaptureBufferStatus.Error if the capture fails. Only when the value is StudioCaptureBufferStatus.Ready does GetBuffer() return image data; otherwise that method raises an error. This property is read-only.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 1

Tags: [ReadOnly, NotReplicated]

GetBuffer

Parameters (0)
No parameters.
Returns (1)
buffer

Returns the captured screenshot as a buffer encoded in the capture's BufferFormat. This method only succeeds when BufferStatus is StudioCaptureBufferStatus.Ready; if the image is not yet available or the capture failed, it raises an error instead of returning a buffer.

History 1

GetErrors

Parameters (0)
No parameters.
Returns (1)
Array

Returns an array of the error messages recorded for this capture. The array is empty when no errors have occurred; when BufferStatus is StudioCaptureBufferStatus.Error, it contains one or more messages describing why the capture or scale failed.

History 1

OriginalSize

TypeDefault
Vector20, 0

The pixel size of the capturable region measured from Position to the bottom-right corner of the Studio view, computed as the screen resolution minus the capture position and clamped to be non-negative. It describes the source area before any cropping or scaling, as distinct from Resolution, which is the pixel size of the encoded image. This property is read-only.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 1

Tags: [ReadOnly, NotReplicated]

Position

TypeDefault
Vector20, 0

The pixel offset of the top-left corner of the captured region from the top-left of the Studio view. It reflects the Position supplied when the capture was requested, defaulting to (0, 0) when none is given. This property is read-only.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 1

Tags: [ReadOnly, NotReplicated]

Resolution

TypeDefault
Vector20, 0

The width and height, in pixels, of the encoded image held by the capture. It is set once the image has been captured and encoded (when BufferStatus becomes StudioCaptureBufferStatus.Ready), and for a capture produced by ScaleAsync() it equals the requested output size. This property is read-only.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 1

Tags: [ReadOnly, NotReplicated]

ScaleAsync

Parameters (2)
strategyResamplerMode
newSizeVector2
Returns (1)
StudioScreenshotCapture

Returns a new StudioScreenshotCapture whose image is computed from this capture, resized to newSize using the given ResamplerMode. The original capture is not modified. ResamplerMode.Default resamples with bilinear filtering, while ResamplerMode.Pixelated uses nearest-neighbor (point) sampling; the scaled capture inherits this capture's Position, OriginalSize, BufferFormat, and UICaptureMode.

This method yields until the scaled image has been encoded. It errors if newSize is not positive, or if this capture's BufferStatus is not StudioCaptureBufferStatus.Ready.

This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

UICaptureMode

TypeDefault
UICaptureModeAll

The UICaptureMode that determines which user interface is composited into the captured image. Defaults to UICaptureMode.All, meaning all UI is included, and reflects the UICaptureMode requested when the capture was created. This property is read-only.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 1

Tags: [ReadOnly, NotReplicated]

Settings