Table of Contents

Class GraphicsFactory

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

Contains static methods and properties related to the graphics objects creation, convertion 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.

DefaultAntialias

Gets or sets default value for IsAntialias property when SKPaint is created by the conversion methods.

DefaultDPI

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

DefaultScaleQuality

Gets or sets default scaling quality used when images are scaled.

FontToFillPaint

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

FontToSkiaFont

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

FontToStrokeAndFillPaint

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

FontToStrokePaint

Gets or sets function which is used when Font is converted to SKPaint with Stroke style.

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 chanell.

GenericBitsFormat

Gets or sets ImageBitsFormat for the GenericImage images.

Handler

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

NativeBitsFormat

Gets or sets ImageBitsFormat for the opaque images.

Methods

CreateFillPaint(SKColor)

Creates SKPaint with Fill style for the specified SKColor value.

CreateFillPaint(SKFont)

Creates SKPaint with Fill style for the specified SKFont value.

CreateMemoryCanvas(Image)

Creates memory canvas for the specified image.

CreateMemoryCanvas(double?)

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

CreateSkiaSurface(GenericImage, ImageLockMode)

Creates ISkiaSurface object for the specified generic image.

CreateSkiaSurface(Image, ImageLockMode)

Creates ISkiaSurface object for the specified image.

CreateStrokeAndFillPaint(BrushAndPen)

Creates SKPaint with StrokeAndFill style for the specified BrushAndPen value.

CreateStrokeAndFillPaint(SKColor)

Creates SKPaint with StrokeAndFill style for the specified SKColor value.

CreateStrokeAndFillPaint(SKFont)

Creates SKPaint with StrokeAndFill style for the specified SKFont value.

CreateStrokePaint(SKColor)

Creates SKPaint with Stroke style for the specified SKColor value.

CreateStrokePaint(SKFont)

Creates SKPaint with Stroke style for the specified SKFont 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(double?)

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

PixelFromDip(PointD, double?)

Converts device-independent units to pixels.

PixelFromDip(RectD, double?)

Converts device-independent units to pixels.

PixelFromDip(SizeD, double?)

Converts device-independent units to pixels.

PixelFromDip(double, double?)

Converts device-independent units to pixels.

PixelToDip(PointI, double?)

Converts PointI to device-independent units.

PixelToDip(RectI, double?)

Converts RectI to device-independent units.

PixelToDip(RectI[], double?)

Converts array of RectI to device-independent units.

PixelToDip(SizeI, double?)

Converts SizeI to device-independent units.

PixelToDip(int, double?)

Converts pixels to device-independent units.

PixelsArgbToRgba(int, int, ARGBValue*, bool)

Converts ARGB to RGBA pixels.

ScaleFactorFromDpi(int)

Converts dpi to scale factor.

ScaleFactorOrDefault(double?)

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

ScaleFactorToDpi(double)

Converts scale factor to dpi.

SetPaintDefaults(SKPaint)

This method is called by all SKPaint create methods. It raises PaintCreated event and initializes SKPaint instance properties with the default values.

Events

PaintCreated

Occurs when SKPaint instance is created by one of the create methods implemented in the GraphicsFactory.