public LinearGradientColorPaintServerPaintServer(PaintServerManager owner, XmlNode node) : base(owner, node) { System.Diagnostics.Debug.Assert(node.Name == SVGTags.sLinearGradient); this.X1 = XmlUtil.AttrValue(node, "x1", double.NaN); this.Y1 = XmlUtil.AttrValue(node, "y1", double.NaN); this.X2 = XmlUtil.AttrValue(node, "x2", double.NaN); this.Y2 = XmlUtil.AttrValue(node, "y2", double.NaN); }
public LinearGradientColorPaintServerPaintServer(PaintServerManager owner, XmlNode node) : base(owner, node) { System.Diagnostics.Debug.Assert(node.Name == SVGTags.sLinearGradient); this.Id = XmlUtil.AttrValue(node, "id"); this.X1 = XmlUtil.AttrValue(node, "x1", double.NaN); this.Y1 = XmlUtil.AttrValue(node, "y1", double.NaN); this.X2 = XmlUtil.AttrValue(node, "x2", double.NaN); this.Y2 = XmlUtil.AttrValue(node, "y2", double.NaN); }
public RadialGradientColorPaintServerPaintServer(PaintServerManager owner, XmlNode node) : base(owner, node) { System.Diagnostics.Debug.Assert(node.Name == SVGTags.sRadialGradient); this.CX = XmlUtil.AttrValue(node, "cx", double.NaN); this.CY = XmlUtil.AttrValue(node, "cy", double.NaN); this.FX = XmlUtil.AttrValue(node, "fx", double.NaN); this.FY = XmlUtil.AttrValue(node, "fy", double.NaN); this.R = XmlUtil.AttrValue(node, "r", double.NaN); this.Normalize(); }
public RadialGradientColorPaintServerPaintServer(PaintServerManager owner, XmlNode node) : base(owner, node) { System.Diagnostics.Debug.Assert(node.Name == SVGTags.sRadialGradient); this.Id = XmlUtil.AttrValue(node, "id"); this.CX = XmlUtil.AttrValue(node, "cx", double.NaN); this.CY = XmlUtil.AttrValue(node, "cy", double.NaN); this.FX = XmlUtil.AttrValue(node, "fx", double.NaN); this.FY = XmlUtil.AttrValue(node, "fy", double.NaN); this.R = XmlUtil.AttrValue(node, "r", double.NaN); this.Normalize(); }
public PatternPaintServer(PaintServerManager owner, SVG svg, XmlNode node) : base(owner) { this.PatternUnits = XmlUtil.AttrValue(node, "patternUnits", string.Empty); string transform = XmlUtil.AttrValue(node, "patternTransform", string.Empty); if (transform.Length > 0) { this.PatternTransform = ShapeUtil.ParseTransform(transform.ToLower()); } m_elements = SVG.Parse(new SVG(), node); this.X = XmlUtil.AttrValue(node, "x", 0, svg.Size.Width); this.Y = XmlUtil.AttrValue(node, "y", 0, svg.Size.Height); this.Width = XmlUtil.AttrValue(node, "width", 1, svg.Size.Width); this.Height = XmlUtil.AttrValue(node, "height", 1, svg.Size.Height); }
public GradientColorPaintServer(PaintServerManager owner, XmlNode node) : base(owner) { this.GradientUnits = XmlUtil.AttrValue(node, "gradientUnits", string.Empty); string transform = XmlUtil.AttrValue(node, "gradientTransform", string.Empty); if (transform.Length > 0) { this.Transform = ShapeUtil.ParseTransform(transform.ToLower()); } if (node.ChildNodes.Count == 0 && XmlUtil.AttrValue(node, "xlink:href", string.Empty).Length > 0) { string refid = XmlUtil.AttrValue(node, "xlink:href", string.Empty); GradientColorPaintServer refcol = owner.Parse(refid.Substring(1)) as GradientColorPaintServer; if (refcol == null) return; this.m_stops = new List<GradientStop>(refcol.m_stops); } foreach (XmlNode childnode in node.ChildNodes) { if (childnode.Name == "stop") { List<XmlAttribute> styleattr = new List<XmlAttribute>(); string fullstyle = XmlUtil.AttrValue(childnode, SVGTags.sStyle, string.Empty); if (fullstyle.Length > 0) { foreach (ShapeUtil.Attribute styleitem in XmlUtil.SplitStyle(null, fullstyle)) styleattr.Add(new XmlUtil.StyleItem(childnode, styleitem.Name, styleitem.Value)); } foreach (XmlAttribute attr1 in styleattr) childnode.Attributes.Append(attr1); double offset = XmlUtil.AttrValue(childnode, "offset", (double)0); string s = XmlUtil.AttrValue(childnode, "stop-color", "#0"); double stopopacity = XmlUtil.AttrValue(childnode, "stop-opacity", (double)1); Color color; if (s.StartsWith("#")) color = PaintServerManager.ParseHexColor(s); else color = PaintServerManager.KnownColor(s); if (stopopacity != 1) color = Color.FromArgb((byte)(stopopacity * 255), color.R, color.G, color.B); if (offset > 1) offset = offset / 100; this.m_stops.Add(new GradientStop(color, offset)); } } }
public SolidColorPaintServer(PaintServerManager owner, Color c) : base(owner) { this.Color = c; }
public PaintServer(PaintServerManager owner) { this.Owner = owner; }
public InheritPaintServer(PaintServerManager owner) : base(owner) { }
public GradientColorPaintServer(PaintServerManager owner, XmlNode node) : base(owner) { this.GradientUnits = XmlUtil.AttrValue(node, "gradientUnits", string.Empty); string transform = XmlUtil.AttrValue(node, "gradientTransform", string.Empty); if (transform.Length > 0) { this.Transform = ShapeUtil.ParseTransform(transform.ToLower()); } if (node.ChildNodes.Count == 0 && XmlUtil.AttrValue(node, "xlink:href", string.Empty).Length > 0) { string refid = XmlUtil.AttrValue(node, "xlink:href", string.Empty); GradientColorPaintServer refcol = owner.Parse(refid.Substring(1)) as GradientColorPaintServer; if (refcol == null) { return; } this.m_stops = new List <GradientStop>(refcol.m_stops); } foreach (XmlNode childnode in node.ChildNodes) { if (childnode.Name == "stop") { var styleattr = new List <XmlUtil.StyleItem>(); string fullstyle = XmlUtil.AttrValue(childnode, SVGTags.sStyle, string.Empty); if (fullstyle.Length > 0) { foreach (ShapeUtil.Attribute styleitem in XmlUtil.SplitStyle(null, fullstyle)) { styleattr.Add(new XmlUtil.StyleItem(styleitem.Name, styleitem.Value)); } } foreach (var attr1 in styleattr) { childnode.Attributes.Append(new TempXmlAttribute(childnode, attr1.Name, attr1.Value)); } double offset = XmlUtil.AttrValue(childnode, "offset", (double)0); string s = XmlUtil.AttrValue(childnode, "stop-color", "#0"); double stopopacity = XmlUtil.AttrValue(childnode, "stop-opacity", (double)1); Color color; if (s.StartsWith("#")) { color = PaintServerManager.ParseHexColor(s); } else { color = PaintServerManager.KnownColor(s); } if (stopopacity != 1) { color = Color.FromArgb((byte)(stopopacity * 255), color.R, color.G, color.B); } if (offset > 1) { offset = offset / 100; } this.m_stops.Add(new GradientStop(color, offset)); } } }
public PatternPaintServer(PaintServerManager owner, Brush newBrush) : base(owner) { Brush = newBrush; }
public PaintServer(PaintServerManager owner, Brush newBrush) { this.Owner = owner; this.Brush = newBrush; }
public CurrentColorPaintServer(PaintServerManager owner) : base(owner) { }
public SolidColorPaintServer(PaintServerManager owner, Color c) : base(owner) { this.Color = c; }
public GradientColorPaintServer(PaintServerManager owner) : base(owner) { }
public SolidColorPaintServer(PaintServerManager owner, Brush newBrush) : base(owner) { Brush = newBrush; }
public LinearGradientColorPaintServerPaintServer(PaintServerManager owner, Brush newBrush) : base(owner) { Brush = newBrush; }
public PaintServer(PaintServerManager owner) { this.Owner = owner; }