Share via


IBitmapExportService.CreateContext(Int32, Int32, Single) Method

Definition

Creates a context for exporting graphics to a bitmap with the specified dimensions and scale.

public Microsoft.Maui.Graphics.BitmapExportContext CreateContext(int width, int height, float displayScale = 1);
abstract member CreateContext : int * int * single -> Microsoft.Maui.Graphics.BitmapExportContext
Public Function CreateContext (width As Integer, height As Integer, Optional displayScale As Single = 1) As BitmapExportContext

Parameters

width
Int32

The width of the bitmap in pixels.

height
Int32

The height of the bitmap in pixels.

displayScale
Single

The scaling factor to apply (default is 1). Use values greater than 1 for higher-resolution exports.

Returns

A new BitmapExportContext that can be used to draw content for export.

Applies to