Class · inherits Instance
StudioScreenshotCapture
Represents a single screenshot captured from Studio, exposing the resulting image buffer and the parameters the capture was taken with.
About StudioScreenshotCapture
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().
Properties 6
BufferFormat
: StudioCaptureScreenshotFormatPluginReadOnlyNotReplicatedThe pixel format of the image data returned byGetBuffer().The
StudioCaptureScreenshotFormatthe capture's image data is encoded in, and therefore the format of the buffer returned byGetBuffer(). Defaults toStudioCaptureScreenshotFormat.RGBA8, in which the buffer holds four bytes (red, green, blue, alpha) per pixel; whenStudioCaptureScreenshotFormat.PNG, the buffer holds a PNG-encoded image. This property is read-only and reflects theFormatrequested when the capture was created.BufferStatus
: StudioCaptureBufferStatusPluginReadOnlyNotReplicatedReflects the current state of the capture as its image data is produced.The
StudioCaptureBufferStatusdescribing where the capture is in its lifecycle. Defaults toStudioCaptureBufferStatus.NotStarted, is set toStudioCaptureBufferStatus.Pendingwhile the image is being captured and encoded, becomesStudioCaptureBufferStatus.Readyonce the image data is available, and becomesStudioCaptureBufferStatus.Errorif the capture fails. Only when the value isStudioCaptureBufferStatus.ReadydoesGetBuffer()return image data; otherwise that method raises an error. This property is read-only.OriginalSize
: Vector2PluginReadOnlyNotReplicatedThe size, in pixels, of the region available for capture fromPositionto the edge of the Studio view.The pixel size of the capturable region measured from
Positionto 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 fromResolution, which is the pixel size of the encoded image. This property is read-only.Position
: Vector2PluginReadOnlyNotReplicatedThe top-left corner, in pixels, of the captured region within the Studio view.The pixel offset of the top-left corner of the captured region from the top-left of the Studio view. It reflects the
Positionsupplied when the capture was requested, defaulting to(0, 0)when none is given. This property is read-only.Resolution
: Vector2PluginReadOnlyNotReplicatedThe pixel dimensions of the captured image.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
BufferStatusbecomesStudioCaptureBufferStatus.Ready), and for a capture produced byScaleAsync()it equals the requested output size. This property is read-only.UICaptureMode
: UICaptureModePluginReadOnlyNotReplicatedIndicates which user-interface layers were included in the capture.The
UICaptureModethat determines which user interface is composited into the captured image. Defaults toUICaptureMode.All, meaning all UI is included, and reflects theUICaptureModerequested when the capture was created. This property is read-only.
Methods 3
GetBuffer
() → bufferPluginReturns the captured image data as a buffer in the capture's pixel format.Returns the captured screenshot as a
bufferencoded in the capture'sBufferFormat. This method only succeeds whenBufferStatusisStudioCaptureBufferStatus.Ready; if the image is not yet available or the capture failed, it raises an error instead of returning a buffer.GetErrors
() → ArrayPluginReturns an array of error messages recorded during the capture.Returns an array of the error messages recorded for this capture. The array is empty when no errors have occurred; when
BufferStatusisStudioCaptureBufferStatus.Error, it contains one or more messages describing why the capture or scale failed.ScaleAsync
(strategy: ResamplerMode, newSize: Vector2) → StudioScreenshotCaptureYieldsPluginProduces a new capture containing a resized copy of this capture's image.Returns a new
StudioScreenshotCapturewhose image is computed from this capture, resized tonewSizeusing the givenResamplerMode. The original capture is not modified.ResamplerMode.Defaultresamples with bilinear filtering, whileResamplerMode.Pixelateduses nearest-neighbor (point) sampling; the scaled capture inherits this capture'sPosition,OriginalSize,BufferFormat, andUICaptureMode.This method yields until the scaled image has been encoded. It errors if
newSizeis not positive, or if this capture'sBufferStatusis notStudioCaptureBufferStatus.Ready.
StudioScreenshotCapture also has every member of Instance. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.