renderComposableToPngBytes

fun renderComposableToPngBytes(iconRenderProperties: IconRenderProperties, content: () -> Unit): ByteArray

Renders a Composable to a PNG image and returns the result as a byte array. This function creates an ImageComposeScene based on the provided IconRenderProperties, renders the Composable content, and encodes the output into PNG format. If scaling is required based on the IconRenderProperties, the rendered content is scaled before encoding.

Return

A byte array containing the rendered PNG image data.

Parameters

iconRenderProperties

Properties for rendering the icon

content

The Composable content to render

Throws

Exception

if rendering fails