Commit c88ad05d authored by davescriven's avatar davescriven
Browse files

All current source code

parent 01b73c95
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Svg
{
/// <summary>
/// Defines the various cordinate systems that a gradient server may use.
/// </summary>
public enum SvgGradientUnit
{
/// <summary>
/// Indicates that the coordinate system of the entire document is to be used.
/// </summary>
UserSpaceOnUse,
/// <summary>
/// Indicates that the coordinate system of the element using the gradient is to be used.
/// </summary>
ObjectBoundingBox
}
}
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing.Drawing2D;
using System.Drawing;
using System.ComponentModel;
namespace Svg
{
public sealed class SvgLinearGradientServer : SvgGradientServer
{
private SvgUnit _x1;
private SvgUnit _y1;
private SvgUnit _x2;
private SvgUnit _y2;
[DefaultValue(typeof(SvgUnit), "0"), SvgAttribute("x1")]
public SvgUnit X1
{
get { return this._x1; }
set
{
this._x1 = value;
}
}
[DefaultValue(typeof(SvgUnit), "0"), SvgAttribute("y1")]
public SvgUnit Y1
{
get { return this._y1; }
set
{
this._y1 = value;
}
}
[DefaultValue(typeof(SvgUnit), "0"), SvgAttribute("x2")]
public SvgUnit X2
{
get { return this._x2; }
set
{
this._x2 = value;
}
}
[DefaultValue(typeof(SvgUnit), "0"), SvgAttribute("y2")]
public SvgUnit Y2
{
get { return this._y2; }
set
{
this._y2 = value;
}
}
public SvgLinearGradientServer()
{
this._x1 = new SvgUnit(0.0f);
this._y1 = new SvgUnit(0.0f);
this._x2 = new SvgUnit(0.0f);
this._y2 = new SvgUnit(0.0f);
}
public SvgPoint Start
{
get { return new SvgPoint(this.X1, this.Y1); }
}
public SvgPoint End
{
get { return new SvgPoint(this.X2, this.Y2); }
}
/// <summary>
/// Gets the name of the element.
/// </summary>
protected override string ElementName
{
get { return "linearGradient"; }
}
public override Brush GetBrush(SvgGraphicsElement owner, float opacity)
{
// Need at least 2 colours to do the gradient fill
if (this.Stops.Count < 2)
return null;
PointF start;
PointF end;
RectangleF bounds = (this.GradientUnits == SvgGradientUnit.ObjectBoundingBox) ? owner.Bounds : owner.OwnerDocument.GetDimensions();
// Have start/end points been set? If not the gradient is horizontal
if (!this.End.IsEmpty())
{
// Get the points to work out an angle
if (this.Start.IsEmpty())
{
start = bounds.Location;
}
else
{
start = new PointF(this.Start.X.ToDeviceValue(owner), this.Start.Y.ToDeviceValue(owner, true));
}
float x = (this.End.X.IsEmpty) ? start.X : this.End.X.ToDeviceValue(owner);
end = new PointF(x, (start.Y + this.End.Y.ToDeviceValue(owner, true)));
}
else
{
// Default: horizontal
start = bounds.Location;
end = new PointF(bounds.Right, bounds.Top);
}
LinearGradientBrush gradient = new LinearGradientBrush(start, end, Color.Transparent, Color.Transparent);
gradient.InterpolationColors = base.GetColourBlend(owner, opacity);
// Needed to fix an issue where the gradient was being wrapped when though it had the correct bounds
gradient.WrapMode = WrapMode.TileFlipX;
return gradient;
}
}
}
\ No newline at end of file
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
namespace Svg
{
[TypeConverter(typeof(SvgPaintServerFactory))]
public abstract class SvgPaintServer : SvgElement
{
public static readonly SvgPaintServer None = new SvgColourServer(Color.Transparent);
public SvgPaintServer()
{
}
protected override void Render(Graphics graphics)
{
// Never render paint servers or their children
}
public abstract Brush GetBrush(SvgGraphicsElement styleOwner, float opacity);
public static bool IsNullOrEmpty(SvgPaintServer server)
{
return (server == null || server == SvgPaintServer.None);
}
public override string ToString()
{
return String.Format("url(#{0})", this.ID);
}
}
}
\ No newline at end of file
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
using System.Drawing;
namespace Svg
{
internal class SvgPaintServerFactory : TypeConverter
{
private static readonly SvgColourConverter _colourConverter;
private static readonly Regex _urlRefPattern;
static SvgPaintServerFactory()
{
_colourConverter = new SvgColourConverter();
_urlRefPattern = new Regex(@"url\((#[^)]+)\)");
}
public static SvgPaintServer Create(string value, SvgDocument document)
{
// If it's pointing to a paint server
if (string.IsNullOrEmpty(value) || value.ToLower().Trim() == "none")
{
return SvgPaintServer.None;
}
else if (value.IndexOf("url(#") > -1)
{
Match match = _urlRefPattern.Match(value);
Uri id = new Uri(match.Groups[1].Value, UriKind.Relative);
return (SvgPaintServer)document.IdManager.GetElementById(id);
}
else // Otherwise try and parse as colour
{
SvgColourServer server = new SvgColourServer((Color)_colourConverter.ConvertFrom(value.Trim()));
return server;
}
}
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
{
return SvgPaintServerFactory.Create((string)value, (SvgDocument)context);
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing.Drawing2D;
using System.Drawing;
using System.ComponentModel;
using Svg.Transforms;
namespace Svg
{
public sealed class SvgPatternServer : SvgPaintServer, ISvgViewPort
{
private SvgUnit _width;
private SvgUnit _height;
private SvgUnit _x;
private SvgUnit _y;
private SvgViewBox _viewBox;
[SvgAttribute("viewBox")]
public SvgViewBox ViewBox
{
get { return this._viewBox; }
set { this._viewBox = value; }
}
[SvgAttribute("width")]
public SvgUnit Width
{
get { return this._width; }
set { this._width = value; }
}
[SvgAttribute("height")]
public SvgUnit Height
{
get { return this._height; }
set { this._height = value; }
}
[SvgAttribute("x")]
public SvgUnit X
{
get { return this._x; }
set { this._x = value; }
}
[SvgAttribute("y")]
public SvgUnit Y
{
get { return this._y; }
set { this._y = value; }
}
public SvgPatternServer()
{
this._x = new SvgUnit(0.0f);
this._y = new SvgUnit(0.0f);
this._width = new SvgUnit(0.0f);
this._height = new SvgUnit(0.0f);
}
public override Brush GetBrush(SvgGraphicsElement renderingElement, float opacity)
{
// If there aren't any children, return null
if (this.Children.Count == 0)
return null;
// Can't render if there are no dimensions
if (this._width.Value == 0.0f || this._height.Value == 0.0f)
return null;
float width = this._width.ToDeviceValue(renderingElement);
float height = this._height.ToDeviceValue(renderingElement, true);
Bitmap image = new Bitmap((int)width, (int)height);
using (Graphics graphics = Graphics.FromImage(image))
{
Matrix patternMatrix = new Matrix();
// Apply a translate if needed
if (this._x.Value > 0.0f || this._y.Value > 0.0f)
{
patternMatrix.Translate(this._x.ToDeviceValue(renderingElement) + -1.0f, this._y.ToDeviceValue(renderingElement, true) + -1.0f);
}
else
{
patternMatrix.Translate(-1, -1);
}
if (this.ViewBox.Height > 0 || this.ViewBox.Width > 0)
{
patternMatrix.Scale(this.Width.ToDeviceValue() / this.ViewBox.Width, this.Height.ToDeviceValue() / this.ViewBox.Height);
}
graphics.Transform = patternMatrix;
graphics.CompositingQuality = CompositingQuality.HighQuality;
graphics.SmoothingMode = SmoothingMode.AntiAlias;
graphics.PixelOffsetMode = PixelOffsetMode.Half;
foreach (SvgElement child in this.Children)
{
child.RenderElement(graphics);
}
graphics.Save();
}
TextureBrush textureBrush = new TextureBrush(image);
return textureBrush;
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
namespace Svg
{
public sealed class SvgRadialGradientServer : SvgGradientServer
{
[SvgAttribute("cx")]
public SvgUnit CenterX
{
get { return this.Attributes.GetAttribute<SvgUnit>("cx"); }
set { this.Attributes["cx"] = value; }
}
[SvgAttribute("cy")]
public SvgUnit CenterY
{
get { return this.Attributes.GetAttribute<SvgUnit>("cy"); }
set { this.Attributes["cy"] = value; }
}
[SvgAttribute("r")]
public SvgUnit Radius
{
get { return this.Attributes.GetAttribute<SvgUnit>("r"); }
set { this.Attributes["r"] = value; }
}
[SvgAttribute("fx")]
public SvgUnit FocalX
{
get { return this.Attributes.GetAttribute<SvgUnit>("fx"); }
set { this.Attributes["fx"] = value; }
}
[SvgAttribute("fy")]
public SvgUnit FocalY
{
get { return this.Attributes.GetAttribute<SvgUnit>("fy"); }
set { this.Attributes["fy"] = value; }
}
/// <summary>
/// Initializes a new instance of the <see cref="SvgRadialGradientServer"/> class.
/// </summary>
public SvgRadialGradientServer()
{
}
/// <summary>
/// Gets the name of the element.
/// </summary>
protected override string ElementName
{
get { return "radialGradient"; }
}
public override Brush GetBrush(SvgGraphicsElement renderingElement, float opacity)
{
GraphicsPath path = new GraphicsPath();
float left = this.CenterX.ToDeviceValue(renderingElement);
float top = this.CenterY.ToDeviceValue(renderingElement, true);
float radius = this.Radius.ToDeviceValue(renderingElement);
RectangleF boundingBox = (this.GradientUnits == SvgGradientUnit.ObjectBoundingBox) ? renderingElement.Bounds : renderingElement.OwnerDocument.GetDimensions();
path.AddEllipse(left-radius, top-radius, radius*2, radius*2);
PathGradientBrush brush = new PathGradientBrush(path);
ColorBlend blend = base.GetColourBlend(renderingElement, opacity);
brush.InterpolationColors = blend;
brush.CenterPoint = new PointF(this.FocalX.ToDeviceValue(renderingElement), this.FocalY.ToDeviceValue(renderingElement, true));
return brush;
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
namespace Svg
{
public enum SvgStrokeLineCap
{
Butt,
Round,
Square,
Inherit
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Svg
{
public enum SvgStrokeLineJoin
{
Miter,
Round,
Bevel
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Svg.Pathing
{
public class SvgArcSegment : SvgPathSegment
{
public override void AddToPath(System.Drawing.Drawing2D.GraphicsPath graphicsPath)
{
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Svg.Pathing
{
public sealed class SvgClosePathSegment : SvgPathSegment
{
public override void AddToPath(System.Drawing.Drawing2D.GraphicsPath graphicsPath)
{
graphicsPath.CloseFigure();
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
namespace Svg.Pathing
{
public sealed class SvgCubicCurveSegment : SvgPathSegment
{
private PointF _firstControlPoint;
private PointF _secondControlPoint;
public PointF FirstControlPoint
{
get { return this._firstControlPoint; }
set { this._firstControlPoint = value; }
}
public PointF SecondControlPoint
{
get { return this._secondControlPoint; }
set { this._secondControlPoint = value; }
}
public SvgCubicCurveSegment(PointF start, PointF firstControlPoint, PointF secondControlPoint, PointF end)
{
this.Start = start;
this.End = end;
this._firstControlPoint = firstControlPoint;
this._secondControlPoint = secondControlPoint;
}
public override void AddToPath(System.Drawing.Drawing2D.GraphicsPath graphicsPath)
{
graphicsPath.AddBezier(this.Start, this.FirstControlPoint, this.SecondControlPoint, this.End);
}
public override string ToString()
{
return String.Format("C {0} {1} {2}", this.FirstControlPoint, this.SecondControlPoint, this.End);
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
namespace Svg.Pathing
{
public sealed class SvgLineSegment : SvgPathSegment
{
public SvgLineSegment(PointF start, PointF end)
{
this.Start = start;
this.End = end;
}
public override void AddToPath(System.Drawing.Drawing2D.GraphicsPath graphicsPath)
{
graphicsPath.AddLine(this.Start, this.End);
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
namespace Svg.Pathing
{
public class SvgMoveToSegment : SvgPathSegment
{
public SvgMoveToSegment(PointF moveTo)
{
this.Start = moveTo;
this.End = moveTo;
}
public override void AddToPath(System.Drawing.Drawing2D.GraphicsPath graphicsPath)
{
graphicsPath.StartFigure();
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using System.Xml;
using System.Diagnostics;
using Svg.Pathing;
namespace Svg
{
[Serializable()]
public class SvgPath : SvgGraphicsElement
{
private SvgPathSegmentList _pathData;
private GraphicsPath _path;
private int _pathLength;
[SvgAttribute("d")]
public SvgPathSegmentList PathData
{
get { return this._pathData; }
set
{
this._pathData = value;
this._pathData._owner = this;
this.IsPathDirty = true;
}
}
[SvgAttribute("pathLength")]
public int PathLength
{
get { return this._pathLength; }
set { this._pathLength = value; }
}
/// <summary>
/// Gets the <see cref="GraphicsPath"/> for this element.
/// </summary>
public override GraphicsPath Path
{
get
{
if (this._path == null || this.IsPathDirty)
{
_path = new GraphicsPath();
foreach (SvgPathSegment segment in this.PathData)
{
segment.AddToPath(_path);
}
this.IsPathDirty = false;
}
return _path;
}
}
internal void OnPathUpdated()
{
this.IsPathDirty = true;
}
protected override bool RequiresSmoothRendering
{
get { return true; }
}
public override System.Drawing.RectangleF Bounds
{
get { return this.Path.GetBounds(); }
}
protected override string ElementName
{
get { return "path"; }
}
public SvgPath()
{
this._pathData = new SvgPathSegmentList();
this._pathData._owner = this;
}
}
}
\ No newline at end of file
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml;
using System.Text.RegularExpressions;
using System.Diagnostics;
using Svg.Pathing;
namespace Svg
{
internal class SvgPathBuilder : TypeConverter
{
public static SvgPathSegmentList Parse(string path)
{
if (string.IsNullOrEmpty(path))
{
throw new ArgumentNullException("path");
}
SvgPathSegmentList segments = new SvgPathSegmentList();
try
{
IEnumerable<PointF> coords;
char command;
PointF controlPoint;
SvgQuadraticCurveSegment lastQuadCurve;
SvgCubicCurveSegment lastCubicCurve;
List<PointF> pointCache = new List<PointF>();
foreach (string commandSet in SvgPathBuilder.SplitCommands(path.TrimEnd(null)))
{
coords = SvgPathBuilder.ParseCoordinates(commandSet, segments);
command = commandSet[0];
// http://www.w3.org/TR/SVG11/paths.html#PathDataGeneralInformation
switch (command)
{
case 'm': // relative moveto
case 'M': // moveto
foreach (PointF point in coords)
{
segments.Add(new SvgMoveToSegment(point));
}
break;
case 'a':
case 'A':
throw new NotImplementedException("Arc segments are not yet implemented");
case 'l': // relative lineto
case 'L': // lineto
foreach (PointF point in coords)
{
segments.Add(new SvgLineSegment(segments.Last.End, point));
}
break;
case 'H': // horizontal lineto
case 'h': // relative horizontal lineto
foreach (PointF point in coords)
{
segments.Add(new SvgLineSegment(segments.Last.End, new PointF(segments.Last.End.X, point.Y)));
}
break;
case 'V': // vertical lineto
case 'v': // relative vertical lineto
foreach (PointF point in coords)
{
segments.Add(new SvgLineSegment(segments.Last.End, new PointF(point.X, segments.Last.End.Y)));
}
break;
case 'Q': // curveto
case 'q': // relative curveto
pointCache.Clear();
foreach (PointF point in coords) { pointCache.Add(point); }
for (int i = 0; i < pointCache.Count; i += 2)
{
segments.Add(new SvgQuadraticCurveSegment(segments.Last.End, pointCache[i], pointCache[i + 1]));
}
break;
case 'T': // shorthand/smooth curveto
case 't': // relative shorthand/smooth curveto
foreach (PointF point in coords)
{
lastQuadCurve = segments.Last as SvgQuadraticCurveSegment;
if (lastQuadCurve != null)
controlPoint = Reflect(lastQuadCurve.ControlPoint, segments.Last.End);
else
controlPoint = segments.Last.End;
segments.Add(new SvgQuadraticCurveSegment(segments.Last.End, controlPoint, point));
}
break;
case 'C': // curveto
case 'c': // relative curveto
pointCache.Clear();
foreach (PointF point in coords) { pointCache.Add(point); }
for (int i = 0; i < pointCache.Count; i += 3)
{
segments.Add(new SvgCubicCurveSegment(segments.Last.End, pointCache[i], pointCache[i + 1], pointCache[i + 2]));
}
break;
case 'S': // shorthand/smooth curveto
case 's': // relative shorthand/smooth curveto
pointCache.Clear();
foreach (PointF point in coords) { pointCache.Add(point); }
for (int i = 0; i < pointCache.Count; i += 2)
{
lastCubicCurve = segments.Last as SvgCubicCurveSegment;
if (lastCubicCurve != null)
{
controlPoint = Reflect(lastCubicCurve.SecondControlPoint, segments.Last.End);
}
else
{
controlPoint = segments.Last.End;
}
segments.Add(new SvgCubicCurveSegment(segments.Last.End, controlPoint, pointCache[i], pointCache[i + 1]));
}
break;
case 'Z': // closepath
case 'z': // relative closepath
segments.Add(new SvgClosePathSegment());
break;
}
}
}
catch
{
Trace.TraceError("Error parsing path \"{0}\".", path);
}
return segments;
}
private static PointF Reflect(PointF point, PointF mirror)
{
// TODO: Only works left to right???
float x = mirror.X + (mirror.X - point.X);
float y = mirror.Y + (mirror.Y - point.Y);
return new PointF(Math.Abs(x), Math.Abs(y));
}
private static PointF ToAbsolute(PointF point, SvgPathSegmentList segments)
{
PointF lastPoint = segments.Last.End;
return new PointF(lastPoint.X + point.X, lastPoint.Y + point.Y);
}
private static IEnumerable<string> SplitCommands(string path)
{
int commandStart = 0;
string command = null;
for (int i = 0; i < path.Length; i++)
{
if (char.IsLetter(path[i]))
{
command = path.Substring(commandStart, i - commandStart).Trim();
commandStart = i;
if (!string.IsNullOrEmpty(command))
{
yield return command;
}
if (path.Length == i + 1)
{
yield return path[i].ToString();
}
}
else if (path.Length == i + 1)
{
command = path.Substring(commandStart, i - commandStart + 1).Trim();
if (!string.IsNullOrEmpty(command))
{
yield return command;
}
}
}
}
private static IEnumerable<PointF> ParseCoordinates(string coords, SvgPathSegmentList segments)
{
// TODO: Handle "1-1" (new PointF(1, -1);
string[] parts = coords.Remove(0, 1).Replace("-", " -").Split(new char[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries);
float x;
float y;
PointF point;
bool relative = char.IsLower(coords[0]);
for (int i = 0; i < parts.Length; i += 2)
{
x = float.Parse(parts[i]);
y = float.Parse(parts[i + 1]);
point = new PointF(x, y);
if (relative)
{
point = SvgPathBuilder.ToAbsolute(point, segments);
}
yield return point;
}
}
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
{
if (value is string)
{
return SvgPathBuilder.Parse((string)value);
}
return base.ConvertFrom(context, culture, value);
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
namespace Svg.Pathing
{
public abstract class SvgPathSegment
{
private PointF _start;
private PointF _end;
public PointF Start
{
get { return this._start; }
set { this._start = value; }
}
public PointF End
{
get { return this._end; }
set { this._end = value; }
}
public abstract void AddToPath(GraphicsPath graphicsPath);
}
}
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
namespace Svg.Pathing
{
[TypeConverter(typeof(SvgPathBuilder))]
public sealed class SvgPathSegmentList : IList<SvgPathSegment>
{
internal SvgPath _owner;
private List<SvgPathSegment> _segments;
internal SvgPathSegmentList()
{
this._segments = new List<SvgPathSegment>();
}
public SvgPathSegment Last
{
get { return this._segments[this._segments.Count-1]; }
}
public int IndexOf(SvgPathSegment item)
{
return this._segments.IndexOf(item);
}
public void Insert(int index, SvgPathSegment item)
{
this._segments.Insert(index, item);
if (this._owner != null)
{
this._owner.OnPathUpdated();
}
}
public void RemoveAt(int index)
{
this._segments.RemoveAt(index);
if (this._owner != null)
{
this._owner.OnPathUpdated();
}
}
public SvgPathSegment this[int index]
{
get { return this._segments[index]; }
set { this._segments[index] = value; this._owner.OnPathUpdated(); }
}
public void Add(SvgPathSegment item)
{
this._segments.Add(item);
if (this._owner != null)
{
this._owner.OnPathUpdated();
}
}
public void Clear()
{
this._segments.Clear();
}
public bool Contains(SvgPathSegment item)
{
return this._segments.Contains(item);
}
public void CopyTo(SvgPathSegment[] array, int arrayIndex)
{
this._segments.CopyTo(array, arrayIndex);
}
public int Count
{
get { return this._segments.Count; }
}
public bool IsReadOnly
{
get { return false; }
}
public bool Remove(SvgPathSegment item)
{
bool removed = this._segments.Remove(item);
if (removed)
{
if (this._owner != null)
{
this._owner.OnPathUpdated();
}
}
return removed;
}
public IEnumerator<SvgPathSegment> GetEnumerator()
{
return this._segments.GetEnumerator();
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return this._segments.GetEnumerator();
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
namespace Svg.Pathing
{
public sealed class SvgQuadraticCurveSegment : SvgPathSegment
{
private PointF _controlPoint;
public PointF ControlPoint
{
get { return this._controlPoint; }
set { this._controlPoint = value; }
}
private PointF FirstControlPoint
{
get
{
float x1 = Start.X + (this.ControlPoint.X - Start.X) * 2 / 3;
float y1 = Start.Y + (this.ControlPoint.Y - Start.Y) * 2 / 3;
return new PointF(x1, y1);
}
}
private PointF SecondControlPoint
{
get
{
float x2 = this.ControlPoint.X + (this.End.X - this.ControlPoint.X) / 3;
float y2 = this.ControlPoint.Y + (this.End.Y - this.ControlPoint.Y) / 3;
return new PointF(x2, y2);
}
}
public SvgQuadraticCurveSegment(PointF start, PointF controlPoint, PointF end)
{
this.Start = start;
this._controlPoint = controlPoint;
this.End = end;
}
public override void AddToPath(System.Drawing.Drawing2D.GraphicsPath graphicsPath)
{
graphicsPath.AddBezier(this.Start, this.FirstControlPoint, this.SecondControlPoint, this.End);
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Svg")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Svg")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2006")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("4b6e2fba-c110-43e9-bd41-e0b7fd067f29")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment