Task RenderToPixmap( Pixmap pixmap )

book_4_sparkGenerated
code_blocksInput

Description

The RenderToPixmap method is a virtual method of the Editor.Assets.AssetPreview class. It is responsible for rendering the current asset preview to a specified Pixmap object. This method is asynchronous and returns a Task, allowing for non-blocking operations.

Usage

To use the RenderToPixmap method, you need to have an instance of Editor.Assets.AssetPreview and a Pixmap object where the rendered image will be stored. Call the method and await its completion to ensure the rendering process is finished before proceeding with any operations that depend on the rendered image.

Example

// Example of using RenderToPixmap

// Assume 'assetPreview' is an instance of Editor.Assets.AssetPreview
// and 'pixmap' is an instance of Editor.Pixmap

async Task RenderAssetPreviewToPixmap(Editor.Assets.AssetPreview assetPreview, Editor.Pixmap pixmap)
{
    await assetPreview.RenderToPixmap(pixmap);
    // The pixmap now contains the rendered asset preview
}