Table of Contents

Class GraphicsFactory

Namespace
Alternet.Drawing
Assembly
Alternet.UI.Common.dll

Contains static methods and properties related to the graphics objects creation, conversion and handling.

public static class GraphicsFactory
Inheritance
GraphicsFactory

Fields

BrushAndPenToStrokeAndFillPaint

Gets or sets function which is used when BrushAndPen is converted to SKPaint with StrokeAndFill style.

ColorToFillPaint

Gets or sets function which is used when Color is converted to SKPaint with Fill style.

ColorToStrokeAndFillPaint

Gets or sets function which is used when Color is converted to SKPaint with StrokeAndFill style.

ColorToStrokePaint

Gets or sets function which is used when Color is converted to SKPaint with StrokeAndFill style.

DefaultDPI

Gets or sets default dpi value used when pixels are converted from/to device-independent units.

FontToSkiaFont

Gets or sets function which is used when Font is converted to SKFont.

PenToPaint

Gets or sets function which is used when Pen is converted to SKPaint.

Properties

AlphaBitsFormat

Gets or sets ImageBitsFormat for the images with alpha channel.

GenericBitsFormat

Gets or sets ImageBitsFormat for the GenericImage images.

Handler

Gets or sets IGraphicsFactoryHandler object which is used internally to perform all the operations.

IsOpenGLAvailable

Gets a value indicating whether OpenGL is available on the current system.

MeasureCanvasOverride

Gets or sets global override for measure canvas.

NativeBitsFormat

Gets or sets ImageBitsFormat for the opaque images.

Methods

CreateMemoryCanvas(CanvasCreateParams)

Creates memory canvas for the specified scale factor. This canvas can be used to perform text measure.

CreateMemoryCanvas(Image)

Creates memory canvas for the specified image.

CreatePaint(SKColor, LineCap, LineJoin, float)

Creates and configures a new SKPaint instance for drawing strokes.

CreateSkiaSurface(GenericImage, ImageLockMode)

Creates ISkiaSurface object for the specified generic image.

CreateSkiaSurface(Image, ImageLockMode)

Creates ISkiaSurface object for the specified image. Consider using transparent images as they are handled faster. Solid images are handled slower as they are converted to GenericImage before rendering. This is required as SkiaSharp does not support all pixel formats. Also on MacOS all images are handled via GenericImage as native image pixels cannot be accessed directly via SkiaSharp.

CreateStrokeAndFillPaint(BrushAndPen)

Creates SKPaint with StrokeAndFill style for the specified BrushAndPen value.

DefaultFontToSkiaFont(Font)

Default implementation of the Font to SKFont conversion.

DefaultPenToPaint(Pen)

Creates SKPaint for the specified Pen value.

GetBitsFormat(ImageBitsFormatKind)

Gets ImageBitsFormat for the specified ImageBitsFormatKind.

GetOrCreateMemoryCanvas(CanvasCreateParams)

Gets memory canvas for the specified scale factor. This canvas can be used to perform text measure.

OnePixelAsDip(float?)

Converts a single pixel to device-independent pixels (DIPs).

PixelFromDip(PointD, float?)

Converts device-independent units to pixels.

PixelFromDip(RectD, float?)

Converts device-independent units to pixels.

PixelFromDip(SizeD, float?)

Converts device-independent units to pixels.

PixelFromDip(float, float?)

Converts device-independent units to pixels.

PixelToDip(PointI, float?)

Converts PointI to device-independent units.

PixelToDip(RectI, float?)

Converts RectI to device-independent units.

PixelToDip(RectI[], float?)

Converts array of RectI to device-independent units.

PixelToDip(SizeI, float?)

Converts SizeI to device-independent units.

PixelToDip(int, float?)

Converts pixels to device-independent units.

PixelToInch(SizeI, float?)

Converts SizeI value (pixels) to SizeD value (inches).

PixelToInch(int, float?)

Converts int value (pixels) to float value (inches).

PixelsArgbToRgba(int, int, ARGBValue*, bool)

Converts ARGB to RGBA pixels.

ScaleFactorFromDpi(int)

Converts dpi to scale factor.

ScaleFactorOrDefault(float?)

Validates scaleFactor and returns default value if it is not specified.

ScaleFactorToDpi(float)

Converts scale factor to dpi.