Click here to Skip to main content
15,891,316 members
Articles / Desktop Programming / WPF

SharpVectors - SVG# Reloaded: An Introduction

Rate me:
Please Sign up or sign in to vote.
4.98/5 (33 votes)
17 Nov 2010BSD10 min read 205.3K   21.7K   101  
A C# library for converting SVG to WPF and viewing SVG files in WPF Applications
// <developer>niklas@protocol7.com</developer>
// <completed>100</completed>

using System;
using SharpVectors.Dom;

namespace SharpVectors.Dom.Svg
{
	/// <summary>
	/// All of the Svg DOM interfaces that correspond directly to 
	/// elements in the Svg language (e.g., the SvgPathElement 
	/// interface corresponds directly to the 'path' element in the 
	/// language) are derivative from base class SvgElement. 
	/// </summary>
	public interface ISvgElement : IElement
	{
		/// <summary>
		/// The value of the id attribute on the given element.
		/// Inheriting class should throw an exception when trying
		/// to update a read only element
		/// </summary>
		string Id 
        { 
            get; set;
        }

		/// <summary>
		/// The nearest ancestor 'svg' element. Null if the given 
		/// element is the outermost 'svg' element.
		/// </summary>
		ISvgSvgElement OwnerSvgElement 
        { 
            get;
        }

		/// <summary>
		///     The element which established the current viewport. 
		///     Often, the nearest ancestor 'svg' element. Null if 
		///     the given element is the outermost 'svg' element.
		/// </summary>
		ISvgElement ViewportElement 
        { 
            get;
        }

        // Support for rendering...

        /// <summary>
        /// Gets a value indicating whether this SVG element is renderable.
        /// </summary>
        /// <value>
        /// This is <see langword="'true"/> if the element is renderable; otherwise,
        /// it is <see langword="false"/>.
        /// </value>
        bool IsRenderable
        {
            get;
        }

        /// <summary>
        /// Gets a value providing a hint on the rendering defined by this element.
        /// </summary>
        /// <value>
        /// An enumeration of the <see cref="SvgRenderingHint"/> specifying the rendering hint.
        /// </value>
        SvgRenderingHint RenderingHint
        {
            get;
        }
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The BSD License


Written By
Engineer
Japan Japan
Systems Engineer

Comments and Discussions