Class SVGSVGElement
Namespace: Aspose.Html.Dom.Svg
Assembly: Aspose.HTML.dll (25.2.0)
A key interface definition is the SVGSVGElement interface, which is the interface that corresponds to the ‘svg’ element. This interface contains various miscellaneous commonly-used utility methods, such as matrix operations and the ability to control the time of redraw on visual rendering devices.
[DOMName("SVGSVGElement")]
[ComVisible(true)]
[DOMObject]
public class SVGSVGElement : SVGGraphicsElement, INotifyPropertyChanged, IEventTarget, IDisposable, IXPathNSResolver, IParentNode, IElementTraversal, IChildNode, IElementCSSInlineStyle, ISVGTests, ISVGFitToViewBox, ISVGZoomAndPan, IDocumentEvent
Inheritance
object ← DOMObject ← EventTarget ← Node ← Element ← SVGElement ← SVGGraphicsElement ← SVGSVGElement
Implements
INotifyPropertyChanged, IEventTarget, IDisposable, IXPathNSResolver, IParentNode, IElementTraversal, IChildNode, IElementCSSInlineStyle, ISVGTests, ISVGFitToViewBox, ISVGZoomAndPan, IDocumentEvent
Inherited Members
SVGGraphicsElement.GetBBox(), SVGGraphicsElement.GetCTM(), SVGGraphicsElement.GetScreenCTM(), SVGGraphicsElement.NearestViewportElement, SVGGraphicsElement.FarthestViewportElement, SVGGraphicsElement.Transform, SVGGraphicsElement.RequiredFeatures, SVGGraphicsElement.RequiredExtensions, SVGGraphicsElement.SystemLanguage, SVGElement.Id, SVGElement.OwnerSVGElement, SVGElement.ViewportElement, SVGElement.ClassName, SVGElement.Style, Element.GetAttributeNames(), Element.HasAttributes(), Element.GetAttribute(string), Element.GetAttributeNS(string, string), Element.SetAttribute(string, string), Element.SetAttributeNS(string, string, string), Element.RemoveAttribute(string), Element.RemoveAttributeNS(string, string), Element.HasAttribute(string), Element.HasAttributeNS(string, string), Element.ToggleAttribute(string), Element.ToggleAttribute(string, bool), Element.GetAttributeNode(string), Element.SetAttributeNode(Attr), Element.RemoveAttributeNode(Attr), Element.GetAttributeNodeNS(string, string), Element.SetAttributeNodeNS(Attr), Element.GetElementsByTagName(string), Element.GetElementsByTagNameNS(string, string), Element.Remove(), Element.QuerySelectorAll(string), Element.QuerySelector(string), Element.AttachShadow(ShadowRootMode), Element.GetElementsByClassName(string), Element.Dispose(bool), Element.ClassList, Element.LocalName, Element.NamespaceURI, Element.Prefix, Element.NodeName, Element.NodeType, Element.TagName, Element.Id, Element.ClassName, Element.TextContent, Element.Attributes, Element.FirstElementChild, Element.LastElementChild, Element.PreviousElementSibling, Element.NextElementSibling, Element.ChildElementCount, Element.Children, Element.InnerHTML, Element.OuterHTML, Element.ShadowRoot, Node.ELEMENT_NODE, Node.ATTRIBUTE_NODE, Node.TEXT_NODE, Node.CDATA_SECTION_NODE, Node.ENTITY_REFERENCE_NODE, Node.ENTITY_NODE, Node.PROCESSING_INSTRUCTION_NODE, Node.COMMENT_NODE, Node.DOCUMENT_NODE, Node.DOCUMENT_TYPE_NODE, Node.DOCUMENT_FRAGMENT_NODE, Node.NOTATION_NODE, Node.HasChildNodes(), Node.Normalize(), Node.CloneNode(), Node.CloneNode(bool), Node.IsEqualNode(Node), Node.IsSameNode(Node), Node.LookupPrefix(string), Node.LookupNamespaceURI(string), Node.IsDefaultNamespace(string), Node.InsertBefore(Node, Node), Node.ReplaceChild(Node, Node), Node.RemoveChild(Node), Node.AppendChild(Node), Node.Dispose(bool), Node.ToString(), Node.NodeType, Node.LocalName, Node.NamespaceURI, Node.Prefix, Node.NodeName, Node.BaseURI, Node.OwnerDocument, Node.ParentNode, Node.ParentElement, Node.ChildNodes, Node.FirstChild, Node.LastChild, Node.PreviousSibling, Node.NextSibling, Node.NodeValue, Node.TextContent, EventTarget.AddEventListener(string, DOMEventHandler, bool), EventTarget.AddEventListener(string, IEventListener), EventTarget.AddEventListener(string, IEventListener, bool), EventTarget.RemoveEventListener(string, DOMEventHandler, bool), EventTarget.RemoveEventListener(string, IEventListener), EventTarget.RemoveEventListener(string, IEventListener, bool), EventTarget.DispatchEvent(Event), EventTarget.Dispose(), EventTarget.Dispose(bool), DOMObject.GetPlatformType(), object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Properties
CurrentScale
On an outermost svg element, this attribute indicates the current scale factor relative to the initial view to take into account user magnification and panning operations, as described under Magnification and panning. DOM attributes currentScale and currentTranslate are equivalent to the 2x3 matrix [a b c d e f] = [currentScale 0 0 currentScale currentTranslate.x currentTranslate.y]. If “magnification” is enabled (i.e., zoomAndPan=“magnify”), then the effect is as if an extra transformation were placed at the outermost level on the SVG document fragment (i.e., outside the outermost svg element). When accessed on an ‘svg’ element that is not an outermost svg element, it is undefined what behavior this attribute has.
[DOMName("currentScale")]
public float CurrentScale { get; set; }
Property Value
CurrentTranslate
On an outermost svg element, the corresponding translation factor that takes into account user “magnification”. When accessed on an ‘svg’ element that is not an outermost svg element, it is undefined what behavior this attribute has.
[DOMName("currentTranslate")]
public SVGPoint CurrentTranslate { get; }
Property Value
Height
Corresponds to attribute ‘height’ on the given ‘svg’ element.
[DOMName("height")]
public SVGAnimatedLength Height { get; }
Property Value
PreserveAspectRatio
Corresponds to attribute ‘preserveAspectRatio’ on the given element.
public SVGAnimatedPreserveAspectRatio PreserveAspectRatio { get; }
Property Value
SVGAnimatedPreserveAspectRatio
ViewBox
Corresponds to attribute ‘viewBox’ on the given element.
public SVGAnimatedRect ViewBox { get; }
Property Value
Width
Corresponds to attribute ‘width’ on the given ‘svg’ element.
[DOMName("width")]
public SVGAnimatedLength Width { get; }
Property Value
X
Corresponds to attribute ‘x’ on the given ‘svg’ element.
[DOMName("x")]
public SVGAnimatedLength X { get; }
Property Value
Y
Corresponds to attribute ‘y’ on the given ‘svg’ element.
[DOMName("y")]
public SVGAnimatedLength Y { get; }
Property Value
ZoomAndPan
Corresponds to attribute ‘zoomAndPan’ on the given element. The value must be one of the SVG_ZOOMANDPAN_* constants defined on this interface.
public ushort ZoomAndPan { get; set; }
Property Value
Exceptions
Code Aspose.Html.Dom.DOMException.NO_MODIFICATION_ALLOWED_ERR. Raised on an attempt to change the value of a read only attribute.
Methods
AnimationsPaused()
Returns true if this SVG document fragment is in a paused state.
[DOMName("animationsPaused")]
public bool AnimationsPaused()
Returns
Boolean indicating whether this SVG document fragment is in a paused state.
CreateEvent(string)
Creates an Aspose.Html.Dom.Events.Event of a type supported by the implementation.
public Event CreateEvent(string eventType)
Parameters
eventType
string
The eventType parameter specifies the type of Aspose.Html.Dom.Events.Event interface to be created.
The Aspose.Html.Dom.Events.IDocumentEvent.CreateEvent(System.String) method is used in creating Aspose.Html.Dom.Events.Events when it is either inconvenient
or unnecessary for the user to create an Aspose.Html.Dom.Events.Event themselves.
In cases where the implementation provided Aspose.Html.Dom.Events.Event is insufficient, users may supply their own
Aspose.Html.Dom.Events.Event implementations for use with the Aspose.Html.Dom.EventTarget.DispatchEvent(Aspose.Html.Dom.Events.Event) method.
Returns
The newly created Aspose.Html.Dom.Events.Event
Exceptions
NOT_SUPPORTED_ERR: Raised if the implementation does not support the type of Aspose.Html.Dom.Events.Event interface requested
CreateSVGAngle()
Creates an SVGAngle object outside of any document trees. The object is initialized to the value 0 degrees (unitless).
[DOMName("createSVGAngle")]
public SVGAngle CreateSVGAngle()
Returns
An SVGAngle object.
CreateSVGLength()
Creates an SVGLength object outside of any document trees. The object is initialized to the value of 0 user units.
[DOMName("createSVGLength")]
public SVGLength CreateSVGLength()
Returns
An SVGLength object.
CreateSVGMatrix()
Creates an SVGMatrix object outside of any document trees. The object is initialized to the identity matrix.
[DOMName("createSVGMatrix")]
public SVGMatrix CreateSVGMatrix()
Returns
An SVGMatrix object.
CreateSVGNumber()
Creates an SVGNumber object outside of any document trees. The object is initialized to a value of zero.
[DOMName("createSVGNumber")]
public SVGNumber CreateSVGNumber()
Returns
An SVGNumber object.
CreateSVGPoint()
Creates an SVGPoint object outside of any document trees. The object is initialized to the point (0,0) in the user coordinate system.
[DOMName("createSVGPoint")]
public SVGPoint CreateSVGPoint()
Returns
An SVGPoint object.
CreateSVGRect()
Creates an SVGRect object outside of any document trees. The object is initialized such that all values are set to 0 user units.
[DOMName("createSVGRect")]
public SVGRect CreateSVGRect()
Returns
An SVGRect object.
CreateSVGTransform()
Creates an SVGTransform object outside of any document trees. The object is initialized to an identity matrix transform (SVG_TRANSFORM_MATRIX).
[DOMName("createSVGTransform")]
public SVGTransform CreateSVGTransform()
Returns
An SVGTransform object.
CreateSVGTransformFromMatrix(SVGMatrix)
Creates an SVGTransform object outside of any document trees. The object is initialized to the given matrix transform (i.e., SVG_TRANSFORM_MATRIX). The values from the parameter matrix are copied, the matrix parameter is not adopted as SVGTransform::matrix.
[DOMName("createSVGTransformFromMatrix")]
public SVGTransform CreateSVGTransformFromMatrix(SVGMatrix matrix)
Parameters
matrix
SVGMatrix
The transform matrix.
Returns
An SVGTransform object.
GetCurrentTime()
Returns the current time in seconds relative to the start time for the current SVG document fragment. If getCurrentTime is called before the document timeline has begun (for example, by script running in a ‘script’ element before the document’s SVGLoad event is dispatched), then 0 is returned.
[DOMName("getCurrentTime")]
public float GetCurrentTime()
Returns
The current time in seconds, or 0 if the document timeline has not yet begun.
GetElementById(string)
Searches this SVG document fragment (i.e., the search is restricted to a subset of the document tree) for an Element whose id is given by elementId. If an Element is found, that Element is returned. If no such element exists, returns null. Behavior is not defined if more than one element has this id.
[DOMName("getElementById")]
public Element GetElementById(string elementId)
Parameters
elementId
string
The unique id value for an element.
Returns
The matching element.
PauseAnimations()
Suspends (i.e., pauses) all currently running animations that are defined within the SVG document fragment corresponding to this ‘svg’ element, causing the animation clock corresponding to this document fragment to stand still until it is unpaused.
[DOMName("pauseAnimations")]
public void PauseAnimations()
SetCurrentTime(float)
Adjusts the clock for this SVG document fragment, establishing a new current time. If setCurrentTime is called before the document timeline has begun (for example, by script running in a ‘script’ element before the document’s SVGLoad event is dispatched), then the value of seconds in the last invocation of the method gives the time that the document will seek to once the document timeline has begun.
[DOMName("setCurrentTime")]
public void SetCurrentTime(float seconds)
Parameters
seconds
float
The new current time in seconds relative to the start time for the current SVG document fragment.
UnpauseAnimations()
Unsuspends (i.e., unpauses) currently running animations that are defined within the SVG document fragment, causing the animation clock to continue from the time at which it was suspended.
[DOMName("unpauseAnimations")]
public void UnpauseAnimations()
See Also
SVGGraphicsElement, ISVGFitToViewBox, IDocumentEvent, IViewCSS, IDocumentCSS