ScreenshotCapture

Utility for capturing and processing screenshots of the current Activity.

NOTE: public (not internal) because :sdk umbrella calls captureScreenshot across the Gradle module boundary. NOT annotated @PublicApi — plan 31-04 excludes it from the BCV surface via ignoredPackages.

Functions

Link copied to clipboard

Captures a screenshot of the current Activity's root view. Uses drawToBitmap from AndroidX Core KTX.

Link copied to clipboard
fun downscale(bitmap: Bitmap, maxWidth: Int = 1080): Bitmap

Downscales a bitmap if its width exceeds the maximum width. Maintains aspect ratio.

Link copied to clipboard
fun toBase64JPEG(bitmap: Bitmap, quality: Int = 80): String

Converts a bitmap to a Base64-encoded JPEG string. Returns a data URI suitable for the API submission.

Link copied to clipboard

Compresses a bitmap to a raw PNG byte array — suitable for com.mcpfeedback.sdk.repo.FeedbackRequest.screenshotPngBytes. The repository layer handles any base64 encoding required by the transport.