Click here to Skip to main content
15,896,063 members
Articles / Programming Languages / C#

Simple SVG Editor

Rate me:
Please Sign up or sign in to vote.
4.38/5 (18 votes)
18 Sep 2007CPOL1 min read 168.2K   12.6K   92  
This application is a combination of two projects from The Code Project: DrawTools by Alex Fry and SVGPad by Maurizio Bigoloni
// --------------------------------------------------------------------------------
// Name:     SvgPolygon
//
// Author:   Maurizio Bigoloni <big71@fastwebnet.it>
//           See the ReleaseNote.txt file for copyright and license information.
//
// Remarks:
//
// --------------------------------------------------------------------------------

using System;
using System.ComponentModel;

namespace SVGLib
{
	/// <summary>
	/// It represents the polygon SVG element.
	/// The 'polygon' element defines a closed shape consisting of a set of connected straight line segments.
	/// </summary>
	public class SvgPolygon : SvgBasicShape
	{
		/// <summary>
		/// The points that make up the polygon. All coordinate values are in the user coordinate system.
		/// </summary>
		[Category("(Specific)")]
		[Description("The points that make up the polygon. All coordinate values are in the user coordinate system.")]
		public string Points
		{
			get	
			{
				return GetAttributeStringValue(SvgAttribute._SvgAttribute.attrSpecific_Points);	
			}

			set	
			{
				SetAttributeValue(SvgAttribute._SvgAttribute.attrSpecific_Points, value);
			}
		}

		/// <summary>
		/// It constructs a polygon element with no attribute.
		/// </summary>
		/// <param name="doc">SVG document.</param>
		public SvgPolygon(SvgDoc doc):base(doc)
		{
			Init();
		}

		/// <summary>
		/// It constructs a polygon element.
		/// </summary>
		/// <param name="doc">SVG document.</param>
		/// <param name="sPoints"></param>
		public SvgPolygon(SvgDoc doc, string sPoints):base(doc)
		{
			Init();

			Points = sPoints;
		}

		private void Init()
		{
			m_sElementName = "polygon";
			m_ElementType = _SvgElementType.typePolygon;

			AddAttr(SvgAttribute._SvgAttribute.attrSpecific_Points, "");
		}
	}
}

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 Code Project Open License (CPOL)


Written By
Web Developer
Russian Federation Russian Federation
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions