Table of Contents

Class RenderTargetBitmap

Namespace
Avalonia.Media.Imaging
Assembly
Avalonia.Base.dll

A bitmap that holds the rendering of a Visual.

public class RenderTargetBitmap : Bitmap, IImage, IDisposable, IImageBrushSource
Inheritance
RenderTargetBitmap
Implements
Inherited Members

Constructors

RenderTargetBitmap(PixelSize)

Initializes a new instance of the RenderTargetBitmap class.

public RenderTargetBitmap(PixelSize pixelSize)

Parameters

pixelSize PixelSize

The size of the bitmap.

RenderTargetBitmap(PixelSize, Vector)

Initializes a new instance of the RenderTargetBitmap class.

public RenderTargetBitmap(PixelSize pixelSize, Vector dpi)

Parameters

pixelSize PixelSize

The size of the bitmap in device pixels.

dpi Vector

The DPI of the bitmap.

Methods

CreateDrawingContext()

Creates a DrawingContext for drawing to the RenderTargetBitmap. Clears the current image data to transparent.

public DrawingContext CreateDrawingContext()

Returns

DrawingContext

The drawing context.

CreateDrawingContext(bool)

Creates a DrawingContext for drawing to the RenderTargetBitmap.

public DrawingContext CreateDrawingContext(bool clear)

Parameters

clear bool

If true, clears the current image data to transparent, if false, leaves the image data unchanged.

Returns

DrawingContext

The drawing context.

Dispose()

public override void Dispose()

Render(Visual)

Renders a visual to the RenderTargetBitmap.

public void Render(Visual visual)

Parameters

visual Visual

The visual to render.