Click here to Skip to main content
15,884,064 members
Articles / Containers / Docker

SVG Artiste - An SVG Editor

Rate me:
Please Sign up or sign in to vote.
4.69/5 (23 votes)
3 Aug 2010CPOL14 min read 95.8K   15.4K   93  
A Vector based tool to create and edit SVG images
// --------------------------------------------------------------------------------
// Name:     SvgCircle
//
// 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 circle SVG element.
	/// </summary>
	public class SvgCircle : SvgBasicShape
	{
		/// <summary>
		/// The x-axis coordinate of the center of the circle.
		/// </summary>
		[Category("(Specific)")]
		[Description("The x-axis coordinate of the center of the circle.")]
		public string CX
		{
			get	
			{
				return GetAttributeStringValue(SvgAttribute._SvgAttribute.attrSpecific_CX);	
			}

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

		/// <summary>
		/// The y-axis coordinate of the center of the circle.
		/// </summary>
		[Category("(Specific)")]
		[Description("The y-axis coordinate of the center of the circle.")]
		public string CY
		{
			get	
			{
				return GetAttributeStringValue(SvgAttribute._SvgAttribute.attrSpecific_CY);	
			}

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

		/// <summary>
		/// The radius of the circle.
		/// </summary>
		[Category("(Specific)")]
		[Description("The radius of the circle.")]
		public string R
		{
			get	
			{
				return GetAttributeStringValue(SvgAttribute._SvgAttribute.attrSpecific_R);	
			}

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

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

		/// <summary>
		/// It constructs a circle element.
		/// </summary>
		/// <param name="doc">SVG document.</param>
		/// <param name="sCX"></param>
		/// <param name="sCY"></param>
		/// <param name="sRadius"></param>
		public SvgCircle(SvgDoc doc, string sCX, string sCY, string sRadius):base(doc)
		{
			Init();

			CX = sCX;
			CY = sCY;
			R = sRadius;
		}

		private void Init()
		{
			m_sElementName = "circle";
			m_ElementType = _SvgElementType.typeCircle;

			AddAttr(SvgAttribute._SvgAttribute.attrSpecific_CX, "");
			AddAttr(SvgAttribute._SvgAttribute.attrSpecific_CY, "");
			AddAttr(SvgAttribute._SvgAttribute.attrSpecific_R, "");
		}
	}
}

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
Engineer
Singapore Singapore
He is a Microsoft technology enthusiast, who wish to create applications which others find useful.He loves making small tools and getting involved in architecting bigger systems.

He is currently working as a professional developer in a software development firm in .Net technologies.

He likes reading technical blogs, contributing to opensource and most importantly, enjoying life.

His ambition is to be an impressive software maker.

Comments and Discussions