Avalonia Code OnlyItaliano

API › RAVAL

RImage class

public static class RImage

Controls drawn into bitmaps.

Methods

static RenderTargetBitmap Render(Control c, double width, double height, double dpi = 96)

The control drawn at width × height dip and the given dpi (96 for the screen, 300 for print).

static RenderTargetBitmap SavePng(Control c, string path, double width, double height, double dpi = 96)

The control saved as PNG; returns the bitmap.

static void SetDpi(string path, double dpi)

Writes the resolution into a PNG file (its pHYs chunk, in pixels per metre), replacing the one that is there: page layout programs then place the figure at its true size.

static double Dpi(string path)

The resolution written in a PNG (NaN if it has no pHYs in metres).

static double Dip(double cm)

The width in dip of a figure that prints cm centimetres wide.