Class SkiaSvg
[ContentProperty("SvgString")]
public class SkiaSvg : SkiaControl, INotifyPropertyChanged, IEffectControlProvider, IToolTipElement, IContextFlyoutElement, IAnimatable, IVisualElementController, IElementController, IView, ITransform, IElement, IVisualTreeElement, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISkiaGestureListener, IHasAfterEffects, ISkiaControl, IDrawnBase, ICanBeUpdatedWithContext, ICanBeUpdated, ISkiaDisposable, IDisposable
- Inheritance
-
SkiaSvg
- Implements
- Inherited Members
- Extension Methods
Constructors
SkiaSvg()
public SkiaSvg()
Fields
AspectProperty
public static readonly BindableProperty AspectProperty
Field Value
FontAwesomePrimaryColorProperty
public static readonly BindableProperty FontAwesomePrimaryColorProperty
Field Value
FontAwesomeSecondaryColorProperty
public static readonly BindableProperty FontAwesomeSecondaryColorProperty
Field Value
GradientBlendModeProperty
public static readonly BindableProperty GradientBlendModeProperty
Field Value
HasContentProperty
public static readonly BindableProperty HasContentProperty
Field Value
HorizontalAlignmentProperty
public static readonly BindableProperty HorizontalAlignmentProperty
Field Value
HorizontalOffsetProperty
public static readonly BindableProperty HorizontalOffsetProperty
Field Value
IconFilePathProperty
public static readonly BindableProperty IconFilePathProperty
Field Value
InflateAmountProperty
public static readonly BindableProperty InflateAmountProperty
Field Value
ShadowBlurProperty
public static readonly BindableProperty ShadowBlurProperty
Field Value
ShadowColorProperty
public static readonly BindableProperty ShadowColorProperty
Field Value
ShadowXProperty
public static readonly BindableProperty ShadowXProperty
Field Value
ShadowYProperty
public static readonly BindableProperty ShadowYProperty
Field Value
SourceProperty
public static readonly BindableProperty SourceProperty
Field Value
SvgHorizontalOptionsProperty
public static readonly BindableProperty SvgHorizontalOptionsProperty
Field Value
SvgStringProperty
public static readonly BindableProperty SvgStringProperty
Field Value
SvgVerticalOptionsProperty
public static readonly BindableProperty SvgVerticalOptionsProperty
Field Value
TintColorProperty
public static readonly BindableProperty TintColorProperty
Field Value
VerticalAlignmentProperty
public static readonly BindableProperty VerticalAlignmentProperty
Field Value
VerticalOffsetProperty
public static readonly BindableProperty VerticalOffsetProperty
Field Value
ZoomProperty
public static readonly BindableProperty ZoomProperty
Field Value
ZoomXProperty
public static readonly BindableProperty ZoomXProperty
Field Value
ZoomYProperty
public static readonly BindableProperty ZoomYProperty
Field Value
Properties
Aspect
public TransformAspect Aspect { get; set; }
Property Value
FontAwesomePrimaryColor
public Color FontAwesomePrimaryColor { get; set; }
Property Value
FontAwesomeSecondaryColor
public Color FontAwesomeSecondaryColor { get; set; }
Property Value
GradientBlendMode
When FIllGradient is set this will override its blend mode for drawing SVG with gradient
public SKBlendMode GradientBlendMode { get; set; }
Property Value
HasContent
public bool HasContent { get; set; }
Property Value
HorizontalAlignment
public DrawImageAlignment HorizontalAlignment { get; set; }
Property Value
HorizontalOffset
public double HorizontalOffset { get; set; }
Property Value
IconFilePath
public string IconFilePath { get; set; }
Property Value
InflateAmount
public double InflateAmount { get; set; }
Property Value
LoadedString
protected string LoadedString { get; set; }
Property Value
RenderingPaint
protected SKPaint RenderingPaint { get; set; }
Property Value
ShadowBlur
public double ShadowBlur { get; set; }
Property Value
ShadowColor
public Color ShadowColor { get; set; }
Property Value
ShadowX
public double ShadowX { get; set; }
Property Value
ShadowY
public double ShadowY { get; set; }
Property Value
Source
public string Source { get; set; }
Property Value
Svg
Protected SKSvg container
public SKSvg Svg { get; protected set; }
Property Value
- SKSvg
SvgHorizontalOptions
public LayoutAlignment SvgHorizontalOptions { get; set; }
Property Value
SvgString
public string SvgString { get; set; }
Property Value
SvgVerticalOptions
public LayoutAlignment SvgVerticalOptions { get; set; }
Property Value
TintColor
public Color TintColor { get; set; }
Property Value
VerticalAlignment
public DrawImageAlignment VerticalAlignment { get; set; }
Property Value
VerticalOffset
public double VerticalOffset { get; set; }
Property Value
Zoom
public double Zoom { get; set; }
Property Value
ZoomX
public double ZoomX { get; set; }
Property Value
ZoomY
public double ZoomY { get; set; }
Property Value
Methods
CalculateDisplayRect(SKRect, float, float, DrawImageAlignment, DrawImageAlignment)
public static SKRect CalculateDisplayRect(SKRect dest, float bmpWidth, float bmpHeight, DrawImageAlignment horizontal, DrawImageAlignment vertical)
Parameters
destSKRectbmpWidthfloatbmpHeightfloathorizontalDrawImageAlignmentverticalDrawImageAlignment
Returns
Clear()
public void Clear()
CreateSvg(string)
Loads svg into container from string. For public access use SvgString property instead.
protected virtual bool CreateSvg(string loadedString)
Parameters
loadedStringstring
Returns
DrawPicture(SKCanvas, SKPicture, SKRect, TransformAspect, DrawImageAlignment, DrawImageAlignment, SKPaint)
protected void DrawPicture(SKCanvas canvas, SKPicture picture, SKRect dest, TransformAspect stretch, DrawImageAlignment horizontal = DrawImageAlignment.Center, DrawImageAlignment vertical = DrawImageAlignment.Center, SKPaint paint = null)
Parameters
canvasSKCanvaspictureSKPicturedestSKRectstretchTransformAspecthorizontalDrawImageAlignmentverticalDrawImageAlignmentpaintSKPaint
LoadSource(string)
This is not replacing current animation, use SetAnimation for that.
public virtual Task LoadSource(string fileName)
Parameters
fileNamestring
Returns
LoadSvgFromBytes(byte[])
Directly loads svg from bytes array into container
public virtual bool LoadSvgFromBytes(byte[] byteArray)
Parameters
byteArraybyte[]
Returns
NeedUpdateIcon(BindableObject, object, object)
protected static void NeedUpdateIcon(BindableObject bindable, object oldvalue, object newvalue)
Parameters
bindableBindableObjectoldvalueobjectnewvalueobject
OnDisposing()
Base performs some cleanup actions with Superview
public override void OnDisposing()
OnPropertyChanged(string)
Method that is called when a bound property is changed.
protected override void OnPropertyChanged(string propertyName = "")
Parameters
propertyNamestringThe name of the bound property that changed.
Paint(DrawingContext)
This is the main drawing routine you should override to draw something. Base one paints background color inside DrawingRect that was defined by Arrange inside base.Draw. Pass arguments if you want to use some time-frozen data for painting at any time from any thread..
protected override void Paint(DrawingContext ctx)
Parameters
ctxDrawingContext
UpdateIcon()
public void UpdateIcon()
UpdateImageFromString(string)
protected void UpdateImageFromString(string source)
Parameters
sourcestring
Events
Error
Happens when loaded with error from Source. Will pass exception.
public event EventHandler<Exception> Error
Event Type
Success
Happens when loaded fine from Source. Will pass source as string.
public event EventHandler<string> Success