Commit c88ad05d authored by davescriven's avatar davescriven
Browse files

All current source code

parent 01b73c95
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
namespace Svg
{
[DefaultProperty("Text")]
public class SvgDescription : SvgElement
{
private string _text;
public string Text
{
get { return this._text; }
set { this._text = value; }
}
public override string ToString()
{
return this.Text;
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml;
using System.Drawing.Drawing2D;
using System.Xml.Schema;
namespace Svg
{
/// <summary>
/// The class used to create and load all SVG documents.
/// </summary>
public class SvgDocument : SvgFragment, ITypeDescriptorContext
{
private SvgElementIdManager _idManager;
private int _ppi;
public static readonly int PPI = 96;
/// <summary>
/// Gets a <see cref="string"/> containing the XLink namespace (http://www.w3.org/1999/xlink).
/// </summary>
public static readonly string XLinkNamespace = "http://www.w3.org/1999/xlink";
/// <summary>
/// Retrieves the <see cref="SvgElement"/> with the specified ID.
/// </summary>
/// <param name="id">A <see cref="string"/> containing the ID of the element to find.</param>
/// <returns>An <see cref="SvgElement"/> of one exists with the specified ID; otherwise false.</returns>
public virtual SvgElement GetElementById(string id)
{
return this.IdManager.GetElementById(id);
}
/// <summary>
/// Gets an <see cref="SvgElementIdManager"/> for this document.
/// </summary>
protected internal virtual SvgElementIdManager IdManager
{
get
{
if (this._idManager == null)
{
this._idManager = new SvgElementIdManager(this);
}
return this._idManager;
}
}
public int Ppi
{
get { return this._ppi; }
set { this._ppi = value; }
}
public SvgDocument()
{
this._ppi = 96;
}
/// <summary>
/// Opens the document at the specified path and loads the contents.
/// </summary>
/// <param name="path">A <see cref="string"/> containing the path of the file to open.</param>
/// <returns>An <see cref="SvgDocument"/> with the contents loaded.</returns>
/// <exception cref="FileNotFoundException">The document at the specified <paramref name="path"/> cannot be found.</exception>
public static SvgDocument Open(string path)
{
if (!File.Exists(path))
{
throw new FileNotFoundException("The specified document cannot be found.", path);
}
return Open(File.OpenRead(path));
}
public static SvgDocument Open(Stream stream)
{
return Open(stream, null);
}
public static SvgDocument OpenRender(Stream stream, Graphics graphics)
{
return null;
}
public static SvgDocument Open(Stream stream, ValidationEventHandler validationEventHandler)
{
Trace.TraceInformation("Begin Read");
using (XmlTextReader reader = new XmlTextReader(stream))
{
Stack<SvgElement> elementStack = new Stack<SvgElement>();
StringBuilder value = new StringBuilder();
SvgElement element = null;
SvgElement parent = null;
SvgDocument svgDocument = null;
reader.XmlResolver = new SvgDtdResolver();
reader.EntityHandling = EntityHandling.ExpandEntities;
bool isEmpty;
// Don't need it
reader.WhitespaceHandling = WhitespaceHandling.None;
while (reader.Read())
{
try
{
switch (reader.NodeType)
{
case XmlNodeType.Element:
// Does this element have a value or children
// (Must do this check here before we progress to another node)
isEmpty = reader.IsEmptyElement;
// Create element
if (elementStack.Count > 0)
{
element = SvgElementFactory.CreateElement(reader, svgDocument);
}
else
{
element = SvgElementFactory.CreateDocument(reader);
svgDocument = (SvgDocument)element;
}
if (element == null)
continue;
// Add to the parents children
if (elementStack.Count > 0)
{
parent = elementStack.Peek();
parent.Children.Add(element);
}
// Push element into stack
elementStack.Push(element);
// Need to process if the element is empty
if (isEmpty)
goto case XmlNodeType.EndElement;
break;
case XmlNodeType.EndElement:
// Skip if no element was created
if (element == null)
continue;
// Pop the element out of the stack
element = elementStack.Pop();
if (value.Length > 0)
{
element.Content = value.ToString();
// Reset content value for new element
value = new StringBuilder();
}
break;
case XmlNodeType.CDATA:
case XmlNodeType.Text:
value.Append(reader.Value);
break;
}
}
catch (Exception exc)
{
Trace.TraceError(exc.Message);
}
}
Trace.TraceInformation("End Read");
return svgDocument;
}
}
public static SvgDocument Open(System.Xml.XmlDocument document)
{
return null;
}
public static Bitmap OpenAsBitmap(string path)
{
return null;
}
public static Bitmap OpenAsBitmap(System.Xml.XmlDocument document)
{
return null;
}
public RectangleF GetDimensions()
{
return new RectangleF(0, 0, this.Width.ToDeviceValue(), this.Height.ToDeviceValue());
return new RectangleF();
}
public void Draw(Graphics graphics)
{
this.Render(graphics);
}
public virtual Bitmap Draw()
{
Trace.TraceInformation("Begin Render");
RectangleF size = this.GetDimensions();
Bitmap bitmap = new Bitmap((int)this.Width.ToDeviceValue(), (int)this.Height.ToDeviceValue());
using (Graphics g = Graphics.FromImage(bitmap))
{
g.TextContrast = 0;
g.PixelOffsetMode = PixelOffsetMode.Half;
this.Render(g);
g.Save();
}
Trace.TraceInformation("End Render");
return bitmap;
}
public void Write(Stream stream)
{
using (XmlTextWriter writer = new XmlTextWriter(stream, Encoding.UTF8))
{
}
}
public void Write(string path)
{
this.Write(File.Create(path));
}
IContainer ITypeDescriptorContext.Container
{
get { throw new NotImplementedException(); }
}
object ITypeDescriptorContext.Instance
{
get { return this; }
}
void ITypeDescriptorContext.OnComponentChanged()
{
throw new NotImplementedException();
}
bool ITypeDescriptorContext.OnComponentChanging()
{
throw new NotImplementedException();
}
PropertyDescriptor ITypeDescriptorContext.PropertyDescriptor
{
get { throw new NotImplementedException(); }
}
object IServiceProvider.GetService(Type serviceType)
{
throw new NotImplementedException();
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.Drawing.Drawing2D;
using System.Drawing;
using System.ComponentModel;
namespace Svg
{
/// <summary>
/// An <see cref="SvgFragment"/> represents an SVG fragment that can be the root element or an embedded fragment of an SVG document.
/// </summary>
public class SvgFragment : SvgElement, ISvgViewPort
{
private SvgUnit _width;
private SvgUnit _height;
private SvgViewBox _viewBox;
/// <summary>
/// Gets the SVG namespace string.
/// </summary>
public static readonly Uri Namespace = new Uri("http://www.w3.org/2000/svg");
/// <summary>
/// Gets or sets the width.
/// </summary>
/// <value>The width.</value>
[SvgAttribute("width")]
public SvgUnit Width
{
get { return this._width; }
set { this._width = value; }
}
/// <summary>
/// Gets or sets the height.
/// </summary>
/// <value>The height.</value>
[SvgAttribute("height")]
public SvgUnit Height
{
get { return this._height; }
set { this._height = value; }
}
/// <summary>
/// Gets or sets the viewport of the element.
/// </summary>
/// <value></value>
[SvgAttribute("viewBox")]
public SvgViewBox ViewBox
{
get { return this._viewBox; }
set { this._viewBox = value; }
}
/// <summary>
/// Gets the name of the element.
/// </summary>
/// <value></value>
protected override string ElementName
{
get { return "svg"; }
}
/// <summary>
/// Renders the specified graphics.
/// </summary>
/// <param name="graphics">The graphics.</param>
protected override void Render(Graphics graphics)
{
Matrix oldTransform = null;
if (!this.ViewBox.Equals(SvgViewBox.Empty))
{
oldTransform = graphics.Transform;
Matrix viewBoxTransform = new Matrix();
if (this.ViewBox.MinX > 0 || this.ViewBox.MinY > 0)
{
viewBoxTransform.Translate(this.ViewBox.MinX, this.ViewBox.MinY, MatrixOrder.Append);
}
viewBoxTransform.Scale(this.Width.ToDeviceValue()/this.ViewBox.Width, this.Height.ToDeviceValue()/this.ViewBox.Height);
graphics.Transform = viewBoxTransform;
}
base.Render(graphics);
if (oldTransform != null)
{
graphics.Transform = oldTransform;
}
}
/// <summary>
/// Initializes a new instance of the <see cref="SvgFragment"/> class.
/// </summary>
public SvgFragment()
{
this._height = new SvgUnit(SvgUnitType.Percentage, 100.0f);
this._width = 1000.0f;
this.ViewBox = SvgViewBox.Empty;
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Xml;
using System.Text;
namespace Svg
{
public class SvgGroup : SvgGraphicsElement
{
public SvgGroup()
{
}
public override System.Drawing.Drawing2D.GraphicsPath Path
{
get { return null; }
}
public override System.Drawing.RectangleF Bounds
{
get { return new System.Drawing.RectangleF(); }
}
protected override void Render(System.Drawing.Graphics graphics)
{
this.PushTransforms(graphics);
base.RenderContents(graphics);
this.PopTransforms(graphics);
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Xml;
using System.Xml.Serialization;
namespace Svg
{
public class SvgUse : SvgGraphicsElement
{
private Uri _referencedElement;
[SvgAttribute("href")]
public virtual Uri ReferencedElement
{
get { return this._referencedElement; }
set { this._referencedElement = value; }
}
public SvgUse()
{
}
public override System.Drawing.Drawing2D.GraphicsPath Path
{
get { return null; }
}
public override System.Drawing.RectangleF Bounds
{
get { return new System.Drawing.RectangleF(); }
}
protected override string ElementName
{
get { return "use"; }
}
protected override void Render(System.Drawing.Graphics graphics)
{
this.PushTransforms(graphics);
SvgGraphicsElement element = (SvgGraphicsElement)this.OwnerDocument.IdManager.GetElementById(this.ReferencedElement);
// For the time of rendering we want the referenced element to inherit
// this elements transforms
SvgElement parent = element._parent;
element._parent = this;
element.RenderElement(graphics);
element._parent = parent;
this.PopTransforms(graphics);
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Svg
{
public class SvgException : FormatException
{
public SvgException(string message) : base(message)
{
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
namespace Svg.FilterEffects
{
public interface ISvgFilter
{
void ApplyFilter(Bitmap sourceGraphic, Graphics renderer);
List<SvgFilterPrimitive> Primitives { get; }
Dictionary<string, Bitmap> Results { get; }
SvgUnit Width { get; set; }
SvgUnit Height { get; set; }
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
namespace Svg.FilterEffects
{
public interface ISvgFilterable
{
ISvgFilter Filter { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
namespace Svg.FilterEffects
{
public class SvgFilter : SvgElement, ISvgFilter
{
private readonly List<SvgFilterPrimitive> _primitives;
private readonly Dictionary<string, Bitmap> _results;
private SvgUnit _width;
private SvgUnit _height;
[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; }
}
public List<SvgFilterPrimitive> Primitives
{
get { return this._primitives; }
}
public Dictionary<string, Bitmap> Results
{
get { return this._results; }
}
public SvgFilter()
{
this._primitives = new List<SvgFilterPrimitive>();
this._results = new Dictionary<string, Bitmap>();
}
protected override void Render(Graphics graphics)
{
// Do nothing
}
public override object Clone()
{
return (SvgFilter)this.MemberwiseClone();
}
public void ApplyFilter(Bitmap sourceGraphic, Graphics renderer)
{
// A bit inefficient to create all the defaults when they may not even be used
this.PopulateDefaults(sourceGraphic);
Bitmap result = null;
foreach (SvgFilterPrimitive primitive in this.Primitives)
{
result = primitive.Apply();
// Add the result to the dictionary for use by other primitives
this._results.Add(primitive.Result, result);
}
// Render the final filtered image
renderer.DrawImageUnscaled(result, new Point(0,0));
}
private void PopulateDefaults(Bitmap sourceGraphic)
{
// Source graphic
//this._results.Add("SourceGraphic", sourceGraphic);
// Source alpha
//this._results.Add("SourceAlpha", ImageProcessor.GetAlphaChannel(sourceGraphic));
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
namespace Svg.FilterEffects
{
public abstract class SvgFilterPrimitive
{
private string _in;
private string _in2;
private string _result;
private ISvgFilter _owner;
protected ISvgFilter Owner
{
get { return this._owner; }
}
public string In
{
get { return this._in; }
set { this._in = value; }
}
public string In2
{
get { return this._in2; }
set { this._in2 = value; }
}
public string Result
{
get { return this._result; }
set { this._result = value; }
}
public SvgFilterPrimitive(ISvgFilter owner, string input)
{
this._in = input;
this._owner = owner;
}
public abstract Bitmap Apply();
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
namespace Svg.FilterEffects
{
public class SvgGaussianBlur : SvgFilterPrimitive
{
private float _standardDeviation;
public SvgGaussianBlur(ISvgFilter owner, string inputGraphic)
: base(owner, inputGraphic)
{
}
/// <summary>
/// The standard deviation for the blur operation.
/// </summary>
public float StandardDeviation
{
get { return this._standardDeviation; }
set { this._standardDeviation = value; }
}
public override Bitmap Apply()
{
Bitmap source = this.Owner.Results[this.In];
Bitmap blur = new Bitmap(source.Width, source.Height);
return source;
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
namespace Svg.FilterEffects
{
public class SvgMerge : SvgFilterPrimitive
{
private StringCollection _mergeResults;
public StringCollection MergeResults
{
get { return this._mergeResults; }
}
public SvgMerge(ISvgFilter owner, string input)
: base(owner, input)
{
this._mergeResults = new StringCollection();
}
public override Bitmap Apply()
{
Bitmap merged = new Bitmap((int)this.Owner.Width.Value, (int)this.Owner.Height.Value);
Graphics mergedGraphics = Graphics.FromImage(merged);
foreach (string resultId in this.MergeResults)
mergedGraphics.DrawImageUnscaled(this.Owner.Results[resultId], new Point(0, 0));
mergedGraphics.Save();
mergedGraphics.Dispose();
return merged;
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Svg
{
public interface ISvgRenderer
{
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
namespace Svg
{
/// <summary>
/// Defines the methods and properties required for an SVG element to be styled.
/// </summary>
public interface ISvgStylable
{
SvgPaintServer Fill { get; set; }
SvgPaintServer Stroke { get; set; }
SvgFillRule FillRule { get; set; }
float Opacity { get; set; }
float FillOpacity { get; set; }
float StrokeOpacity { get; set; }
SvgUnit StrokeWidth { get; set; }
SvgStrokeLineCap StrokeLineCap { get; set; }
SvgStrokeLineJoin StrokeLineJoin { get; set; }
float StrokeMiterLimit { get; set; }
SvgUnit[] StrokeDashArray { get; set; }
SvgUnit StrokeDashOffset { get; set; }
GraphicsPath Path { get; }
RectangleF Bounds { get; }
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Svg
{
/// <summary>
/// Converts string representations of colours into <see cref="Color"/> objects.
/// </summary>
public class SvgColourConverter : System.Drawing.ColorConverter
{
/// <summary>
/// Converts the given object to the converter's native type.
/// </summary>
/// <param name="context">A <see cref="T:System.ComponentModel.TypeDescriptor"/> that provides a format context. You can use this object to get additional information about the environment from which this converter is being invoked.</param>
/// <param name="culture">A <see cref="T:System.Globalization.CultureInfo"/> that specifies the culture to represent the color.</param>
/// <param name="value">The object to convert.</param>
/// <returns>
/// An <see cref="T:System.Object"/> representing the converted value.
/// </returns>
/// <exception cref="T:System.ArgumentException">The conversion cannot be performed.</exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true"/>
/// </PermissionSet>
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
{
string colour = value as string;
if (colour != null)
{
colour = colour.Trim();
if (colour.StartsWith("rgb"))
{
try
{
int start = colour.IndexOf("(") + 1;
string[] values = colour.Substring(start, colour.IndexOf(")") - start).Split(new char[]{',', ' '}, StringSplitOptions.RemoveEmptyEntries);
return System.Drawing.Color.FromArgb(int.Parse(values[0]), int.Parse(values[1]), int.Parse(values[2]));
}
catch
{
throw new SvgException("Colour is in an invalid format: '" + colour + "'");
}
}
else if (colour.StartsWith("#") && colour.Length == 4)
{
colour = string.Format(culture, "#{0}{0}{1}{1}{2}{2}", colour[1], colour[2], colour[3]);
return base.ConvertFrom(context, culture, colour);
}
else
{
return base.ConvertFrom(context, culture, 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;
namespace Svg
{
public sealed class SvgColourServer : SvgPaintServer
{
public SvgColourServer() : this(Color.Transparent)
{
}
public SvgColourServer(Color colour)
{
this._colour = colour;
}
private Color _colour;
public Color Colour
{
get { return this._colour; }
set { this._colour = value; }
}
public override Brush GetBrush(SvgGraphicsElement styleOwner, float opacity)
{
int alpha = (int)((opacity * (this.Colour.A/255) ) * 255);
Color colour = Color.FromArgb(alpha, this.Colour);
SolidBrush brush = new SolidBrush(colour);
return brush;
}
public override string ToString()
{
Color c = this.Colour;
// Return the name if it exists
if (c.IsKnownColor)
return c.Name;
// Return the hex value
return String.Format("#{0}", c.ToArgb().ToString("x").Substring(2));
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Svg
{
public enum SvgFillRule
{
NonZero,
EvenOdd,
Inherit
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
namespace Svg
{
public abstract class SvgGradientServer : SvgPaintServer
{
private SvgGradientUnit _gradientUnits;
private SvgGradientSpreadMethod _spreadMethod = SvgGradientSpreadMethod.Pad;
private SvgGradientServer _inheritGradient;
private List<SvgGradientStop> _stops;
internal SvgGradientServer()
{
this.GradientUnits = SvgGradientUnit.ObjectBoundingBox;
this._stops = new List<SvgGradientStop>();
}
protected override void ElementAdded(SvgElement child, int index)
{
if (child is SvgGradientStop)
this.Stops.Add((SvgGradientStop)child);
base.ElementAdded(child, index);
}
protected override void ElementRemoved(SvgElement child)
{
if (child is SvgGradientStop)
this.Stops.Add((SvgGradientStop)child);
base.ElementRemoved(child);
}
public List<SvgGradientStop> Stops
{
get { return this._stops; }
}
[SvgAttribute("spreadMethod")]
public SvgGradientSpreadMethod SpreadMethod
{
get { return this._spreadMethod; }
set { this._spreadMethod = value; }
}
[SvgAttribute("gradientUnits")]
public SvgGradientUnit GradientUnits
{
get { return this._gradientUnits; }
set { this._gradientUnits = value; }
}
public SvgGradientServer InheritGradient
{
get { return this._inheritGradient; }
set { this._inheritGradient = value; }
}
protected ColorBlend GetColourBlend(SvgGraphicsElement owner, float opacity)
{
ColorBlend blend = new ColorBlend();
int colourBlends = this.Stops.Count;
bool insertStart = false;
bool insertEnd = false;
//gradient.Transform = renderingElement.Transforms.Matrix;
// May need to increase the number of colour blends because the range *must* be from 0.0 to 1.0.
// E.g. 0.5 - 0.8 isn't valid therefore the rest need to be calculated.
// If the first stop doesn't start at zero
if (this.Stops[0].Offset.Value > 0)
{
colourBlends++;
// Indicate that a colour has to be dynamically added at the start
insertStart = true;
}
// If the last stop doesn't end at 1 a stop
float lastValue = this.Stops[this.Stops.Count - 1].Offset.Value;
if (lastValue < 100 || lastValue < 1)
{
colourBlends++;
// Indicate that a colour has to be dynamically added at the end
insertEnd = true;
}
blend.Positions = new float[colourBlends];
blend.Colors = new Color[colourBlends];
// Set positions and colour values
int actualStops = 0;
float mergedOpacity = 0.0f;
float position = 0.0f;
Color colour = Color.Black;
for (int i = 0; i < colourBlends; i++)
{
mergedOpacity = opacity * this.Stops[actualStops].Opacity;
position = (this.Stops[actualStops].Offset.ToDeviceValue(owner) / owner.Bounds.Width);
colour = Color.FromArgb((int)(mergedOpacity * 255), this.Stops[actualStops++].Colour);
// Insert this colour before itself at position 0
if (insertStart && i == 0)
{
blend.Positions[i] = 0.0f;
blend.Colors[i++] = colour;
}
blend.Positions[i] = position;
blend.Colors[i] = colour;
// Insert this colour after itself at position 0
if (insertEnd && i == colourBlends - 2)
{
blend.Positions[i + 1] = 1.0f;
blend.Colors[++i] = colour;
}
}
return blend;
}
protected virtual List<SvgGradientStop> InheritStops()
{
List<SvgGradientStop> stops = new List<SvgGradientStop>();
if (this.Stops.Count > 0)
return stops;
if (this.InheritGradient != null)
{
List<SvgGradientStop> ownerStops = this.InheritGradient.InheritStops();
stops.AddRange(ownerStops);
}
return stops;
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Svg
{
public enum SvgGradientSpreadMethod
{
Pad,
Reflect,
Repeat
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.ComponentModel;
namespace Svg
{
public class SvgGradientStop : SvgElement
{
private SvgUnit _offset;
private Color _colour;
private float _opacity;
[SvgAttribute("offset")]
public SvgUnit Offset
{
get { return this._offset; }
set { this._offset = value; }
}
[SvgAttribute("stop-color")]
[TypeConverter(typeof(SvgColourConverter))]
public Color Colour
{
get { return this._colour; }
set { this._colour = value; }
}
[SvgAttribute("stop-opacity")]
public float Opacity
{
get { return this._opacity; }
set { this._opacity = value; }
}
protected override string ElementName
{
get { return "stop"; }
}
public SvgGradientStop()
{
this._offset = new SvgUnit(0.0f);
this._colour = Color.Transparent;
this._opacity = 1.0f;
}
public SvgGradientStop(SvgUnit offset, Color colour)
{
this._offset = offset;
this._colour = colour;
this._opacity = 1.0f;
}
}
}
\ No newline at end of file
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