Table of Contents

Class Svg

Namespace
Gtk
Assembly
Gtk-4.0.dll
public class Svg : Object, Paintable, SymbolicPaintable, NativeObject, IDisposable, GTypeProvider, InstanceFactory
Inheritance
Svg
Implements
Inherited Members

Constructors

Svg(params ConstructArgument[])

[Obsolete("Regular C# constructors on native classes will be removed in a future version. Please see the linked documentation for more details. It contains scenarios and possible solutions to prepare for the upcoming changes.", DiagnosticId = "GirCore1007", UrlFormat = "https://gircore.github.io/docs/integration/diagnostic/1007.html")]
public Svg(params ConstructArgument[] constructArguments)

Parameters

constructArguments ConstructArgument[]

Svg(CreationData)

[Obsolete("This constructor is a workaround to keep legacy APIs alive. Do not use it.")]
protected Svg(CreationData data)

Parameters

data CreationData

Svg(SvgHandle)

protected Svg(SvgHandle handle)

Parameters

handle SvgHandle

Fields

ErrorSignal

Signal Descriptor for OnError.

public static readonly Signal<Svg, Svg.ErrorSignalArgs> ErrorSignal

Field Value

Signal<Svg, Svg.ErrorSignalArgs>

FeaturesPropertyDefinition

public static readonly Property<SvgFeatures, Svg> FeaturesPropertyDefinition

Field Value

Property<SvgFeatures, Svg>

InvalidateContentsSignal

Signal Descriptor for OnInvalidateContents.

public static readonly Signal<Paintable> InvalidateContentsSignal

Field Value

Signal<Paintable>

InvalidateSizeSignal

Signal Descriptor for OnInvalidateSize.

public static readonly Signal<Paintable> InvalidateSizeSignal

Field Value

Signal<Paintable>

PlayingPropertyDefinition

public static readonly Property<bool, Svg> PlayingPropertyDefinition

Field Value

Property<bool, Svg>

ResourcePropertyDefinition

public static readonly Property<string?, Svg> ResourcePropertyDefinition

Field Value

Property<string, Svg>

StatePropertyDefinition

public static readonly Property<uint, Svg> StatePropertyDefinition

Field Value

Property<uint, Svg>

WeightPropertyDefinition

public static readonly Property<double, Svg> WeightPropertyDefinition

Field Value

Property<double, Svg>

Properties

Features

public SvgFeatures Features { get; set; }

Property Value

SvgFeatures

Playing

public bool Playing { get; set; }

Property Value

bool

Resource

public string? Resource { get; set; }

Property Value

string

State

public uint State { get; set; }

Property Value

uint

Weight

public double Weight { get; set; }

Property Value

double

Methods

ComputeConcreteSize(double, double, double, double, out double, out double)

public void ComputeConcreteSize(double specifiedWidth, double specifiedHeight, double defaultWidth, double defaultHeight, out double concreteWidth, out double concreteHeight)

Parameters

specifiedWidth double
specifiedHeight double
defaultWidth double
defaultHeight double
concreteWidth double
concreteHeight double

GetCurrentImage()

public Paintable GetCurrentImage()

Returns

Paintable

GetFeatures()

[Version("4.22")]
public SvgFeatures GetFeatures()

Returns

SvgFeatures

GetFlags()

public PaintableFlags GetFlags()

Returns

PaintableFlags

GetGType()

public static Type GetGType()

Returns

Type

GetIntrinsicAspectRatio()

public double GetIntrinsicAspectRatio()

Returns

double

GetIntrinsicHeight()

public int GetIntrinsicHeight()

Returns

int

GetIntrinsicWidth()

public int GetIntrinsicWidth()

Returns

int

GetState()

[Version("4.22")]
public uint GetState()

Returns

uint

GetStateNames(out uint)

[Version("4.22")]
public string[]? GetStateNames(out uint length)

Parameters

length uint

Returns

string[]

GetWeight()

[Version("4.22")]
public double GetWeight()

Returns

double

InvalidateContents()

public void InvalidateContents()

InvalidateSize()

public void InvalidateSize()

LoadFromBytes(Bytes)

[Version("4.22")]
public void LoadFromBytes(Bytes bytes)

Parameters

bytes Bytes

LoadFromResource(string)

[Version("4.22")]
public void LoadFromResource(string path)

Parameters

path string

New()

[Version("4.22")]
public static Svg New()

Returns

Svg

NewFromBytes(Bytes)

[Version("4.22")]
public static Svg NewFromBytes(Bytes bytes)

Parameters

bytes Bytes

Returns

Svg

NewFromPointer(nint, bool)

Creates a new managed Svg instance for a given pointer.

public static Svg NewFromPointer(nint ptr, bool ownsHandle)

Parameters

ptr nint
ownsHandle bool

Returns

Svg

NewFromResource(string)

[Version("4.22")]
public static Svg NewFromResource(string path)

Parameters

path string

Returns

Svg

NewWithProperties(ConstructArgument[])

Creates a new Svg and sets the properties specified by the construct arguments.

public static Svg NewWithProperties(ConstructArgument[] constructArguments)

Parameters

constructArguments ConstructArgument[]

The properties to set.

Returns

Svg

Pause()

[Version("4.22")]
public void Pause()

Play()

[Version("4.22")]
public void Play()

Serialize()

[Version("4.22")]
public Bytes Serialize()

Returns

Bytes

SetFeatures(SvgFeatures)

[Version("4.22")]
public void SetFeatures(SvgFeatures features)

Parameters

features SvgFeatures

SetFrameClock(FrameClock)

[Version("4.22")]
public void SetFrameClock(FrameClock clock)

Parameters

clock FrameClock

SetState(uint)

[Version("4.22")]
public void SetState(uint state)

Parameters

state uint

SetWeight(double)

[Version("4.22")]
public void SetWeight(double weight)

Parameters

weight double

Snapshot(Snapshot, double, double)

public void Snapshot(Snapshot snapshot, double width, double height)

Parameters

snapshot Snapshot
width double
height double

SnapshotSymbolic(Snapshot, double, double, RGBA[])

[Version("4.6")]
public void SnapshotSymbolic(Snapshot snapshot, double width, double height, RGBA[] colors)

Parameters

snapshot Snapshot
width double
height double
colors RGBA[]

SnapshotWithWeight(Snapshot, double, double, RGBA[], double)

[Version("4.22")]
public void SnapshotWithWeight(Snapshot snapshot, double width, double height, RGBA[] colors, double weight)

Parameters

snapshot Snapshot
width double
height double
colors RGBA[]
weight double

WriteToFile(string)

[Version("4.22")]
public bool WriteToFile(string filename)

Parameters

filename string

Returns

bool

Events

OnError

public event SignalHandler<Svg, Svg.ErrorSignalArgs> OnError

Event Type

SignalHandler<Svg, Svg.ErrorSignalArgs>

OnInvalidateContents

public event SignalHandler<Paintable> OnInvalidateContents

Event Type

SignalHandler<Paintable>

OnInvalidateSize

public event SignalHandler<Paintable> OnInvalidateSize

Event Type

SignalHandler<Paintable>