public WpfRendering(SvgElement element) : base(element) { _maskUnits = SvgUnitType.UserSpaceOnUse; _clipPathUnits = SvgUnitType.UserSpaceOnUse; _maskContentUnits = SvgUnitType.UserSpaceOnUse; }
public SvgLengthList(string propertyName, string listString, SvgElement ownerElement, SvgLengthDirection direction) { this.propertyName = propertyName; this.ownerElement = ownerElement; this.direction = direction; this.FromString(listString); }
public void InitTest() { if(!initDone) { doc = LoadXml("<rect height='1' width='1' />"); elm = (SvgElement)doc.SelectSingleNode("//*[local-name()='rect']"); initDone = true; } }
public SvgLength(SvgElement ownerElement, string propertyName, SvgLengthDirection direction, string baseVal, string defaultValue) : this(ownerElement, propertyName, SvgLengthSource.String, direction, defaultValue) { if(baseVal == null || baseVal.Length == 0) { baseVal = defaultValue; } baseVal = SvgNumber.ScientificToDec(baseVal); cssLength = new CssAbsPrimitiveLengthValue(new CssPrimitiveLengthValue(baseVal, false), propertyName, ownerElement); }
public static string GetElementName(SvgElement element) { if (element == null) { return String.Empty; } string elementId = element.Id; if (elementId != null) { elementId = elementId.Trim(); } if (String.IsNullOrEmpty(elementId)) { return String.Empty; } if (elementId.Contains("&#x")) { elementId = HttpUtility.HtmlDecode(elementId); } if (elementId.Contains("レイヤー")) { elementId = elementId.Replace("レイヤー", "Layer"); } else if (elementId.Equals("イラスト")) { elementId = "Illustration"; } else if (elementId.Equals("台紙")) { elementId = "Mount"; } else if (elementId.Equals("キャプション")) { elementId = "Caption"; } else if (elementId.Equals("細線")) { elementId = "ThinLine"; } int numberId = 0; if (Int32.TryParse(elementId, out numberId)) { return String.Empty; } elementId = elementId.Replace(':', '_'); elementId = elementId.Replace(' ', '_'); elementId = elementId.Replace('.', '_'); elementId = elementId.Replace('-', '_'); return elementId; }
public static Matrix GetTransformMatrix(SvgElement element) { ISvgTransformable transElm = element as ISvgTransformable; if (transElm == null) return Matrix.Identity; SvgTransformList svgTList = (SvgTransformList)transElm.Transform.AnimVal; //SvgTransform svgTransform = (SvgTransform)svgTList.Consolidate(); SvgMatrix svgMatrix = ((SvgTransformList)transElm.Transform.AnimVal).TotalMatrix; return new Matrix(svgMatrix.A, svgMatrix.B, svgMatrix.C, svgMatrix.D, svgMatrix.E, svgMatrix.F); }
public WpfTextRendering(SvgElement element) : base(element) { _textElement = element as SvgTextElement; if (_textElement == null) { throw new InvalidOperationException(); } _horzRenderer = new WpfHorzTextRenderer(_textElement, this); _vertRenderer = new WpfVertTextRenderer(_textElement, this); _pathRenderer = new WpfPathTextRenderer(_textElement, this); }
public SvgLength(SvgElement ownerElement, string propertyName, SvgLengthSource source, SvgLengthDirection direction, string defaultValue) { this.ownerElement = ownerElement; this.propertyName = propertyName; this.direction = direction; this.defaultValue = defaultValue; this.source = source; if(this.source == SvgLengthSource.Xml || this.source == SvgLengthSource.Css) { getCssXmlValue(); } }
public static string GetElementName(SvgElement element) { if (element == null) { return String.Empty; } string elementId = element.Id; if (elementId != null) { elementId = elementId.Trim(); } if (String.IsNullOrEmpty(elementId)) { return String.Empty; } elementId = elementId.Replace(':', '_'); elementId = elementId.Replace(" ", String.Empty); elementId = elementId.Replace('.', '_'); elementId = elementId.Replace('-', '_'); return elementId; }
public SvgUriReference(SvgElement ownerElement) { _ownerElement = ownerElement; _ownerElement.attributeChangeHandler += OnAttributeChange; }
public SvgViewSpec(SvgElement ownerElement) : base(ownerElement) { // only use the base... }
public GdiTextRendering(SvgElement element) : base(element) { }
public GdiMarkerRendering(SvgElement element) : base(element) { }
public WpfGroupRendering(SvgElement element) : base(element) { }
public SvgAnimatedPreserveAspectRatio(string attr, SvgElement ownerElement) { baseVal = new SvgPreserveAspectRatio(attr, ownerElement); animVal = baseVal; }
public SvgLength(SvgElement ownerElement, string propertyName, SvgLengthDirection direction, string baseVal) : this(ownerElement, propertyName, direction, baseVal, string.Empty) { }
public SvgFitToViewBox(SvgElement ownerElement) { this.ownerElement = ownerElement; this.ownerElement.attributeChangeHandler += new NodeChangeHandler(AttributeChange); }
public SvgZoomAndPan(SvgElement ownerElement) { this.ownerElement = ownerElement; }
public SvgLength(string propertyName, SvgStyleableElement ownerElement, SvgLengthDirection direction, string defaultValue) { this.ownerElement = ownerElement; this.direction = direction; string baseVal = ownerElement.GetPropertyValue(propertyName); if (baseVal == null || baseVal == "") { baseVal = defaultValue; } baseVal = SvgNumber.ScientificToDec(baseVal); this.cssLength = new CssAbsPrimitiveLengthValue(new CssPrimitiveLengthValue(baseVal, false), propertyName, ownerElement); }
public SvgLength(string propertyName, string baseVal, string defaultValue, SvgElement ownerElement, SvgLengthDirection direction) { this.ownerElement = ownerElement; this.direction = direction; if (baseVal == null || baseVal.Length == 0) { baseVal = defaultValue; } baseVal = SvgNumber.ScientificToDec(baseVal); this.cssLength = new CssAbsPrimitiveLengthValue(new CssPrimitiveLengthValue(baseVal, false), propertyName, ownerElement); }
public SvgTests(SvgElement ownerElement) { this.ownerElement = ownerElement; this.ownerElement.attributeChangeHandler += new NodeChangeHandler(AttributeChange); }
protected void FitToViewbox(WpfDrawingContext context, SvgElement svgElement, Rect elementBounds) { if (svgElement == null) { return; } ISvgFitToViewBox fitToView = svgElement as ISvgFitToViewBox; if (fitToView == null) { return; } SvgPreserveAspectRatio spar = (SvgPreserveAspectRatio)fitToView.PreserveAspectRatio.AnimVal; double[] transformArray = spar.FitToViewBox((SvgRect)fitToView.ViewBox.AnimVal, new SvgRect(elementBounds.X, elementBounds.Y, elementBounds.Width, elementBounds.Height)); double translateX = transformArray[0]; double translateY = transformArray[1]; double scaleX = transformArray[2]; double scaleY = transformArray[3]; Transform translateMatrix = null; Transform scaleMatrix = null; //if (translateX != 0 || translateY != 0) { translateMatrix = new TranslateTransform(translateX, translateY); } if ((float)scaleX != 1.0f && (float)scaleY != 1.0f) { scaleMatrix = new ScaleTransform(scaleX, scaleY); } if (translateMatrix != null && scaleMatrix != null) { // Create a TransformGroup to contain the transforms // and add the transforms to it. TransformGroup transformGroup = new TransformGroup(); transformGroup.Children.Add(scaleMatrix); transformGroup.Children.Add(translateMatrix); this.Transform = transformGroup; } else if (translateMatrix != null) { this.Transform = translateMatrix; } else if (scaleMatrix != null) { this.Transform = scaleMatrix; } }
public SvgExternalResourcesRequired(SvgElement ownerElement) { this.ownerElement = ownerElement; this.ownerElement.attributeChangeHandler += new NodeChangeHandler(AttributeChange); }
public SvgAnimatedLength(SvgElement ownerElement, string propertyName, SvgLengthDirection direction, string strValue, string defaultValue) { baseVal = new SvgLength(ownerElement, propertyName, direction, strValue, defaultValue); }
public SvgFitToViewBox(SvgElement ownerElement) { _ownerElement = ownerElement; _ownerElement.attributeChangeHandler += OnAttributeChange; }
public SvgAnimatedLength(SvgElement ownerElement, string propertyName, SvgLengthDirection direction, string strValue, string defaultValue) { _baseVal = new SvgLength(ownerElement, propertyName, direction, strValue, defaultValue); _animVal = _baseVal; }
public SvgExternalResourcesRequired(SvgElement ownerElement) { _ownerElement = ownerElement; _ownerElement.attributeChangeHandler += OnAttributeChange; }
public WpfUseRendering(SvgElement element) : base(element) { }
public SvgPreserveAspectRatio(string attr, SvgElement ownerElement) { this.ownerElement = ownerElement; Match match = parCheck.Match(attr.Trim()); if (match.Groups["align"].Success) { switch (match.Groups["align"].Value) { case "none": _alignment = SvgPreserveAspectRatioType.None; break; case "xMinYMin": _alignment = SvgPreserveAspectRatioType.XMinYMin; break; case "xMidYMin": _alignment = SvgPreserveAspectRatioType.XMidYMin; break; case "xMaxYMin": _alignment = SvgPreserveAspectRatioType.XMaxYMin; break; case "xMinYMid": _alignment = SvgPreserveAspectRatioType.XMinYMid; break; case "xMaxYMid": _alignment = SvgPreserveAspectRatioType.XMaxYMid; break; case "xMinYMax": _alignment = SvgPreserveAspectRatioType.XMinYMax; break; case "xMidYMax": _alignment = SvgPreserveAspectRatioType.XMidYMax; break; case "xMaxYMax": _alignment = SvgPreserveAspectRatioType.XMaxYMax; break; default: _alignment = SvgPreserveAspectRatioType.XMidYMid; _isDefaultAlign = true; break; } } else { _alignment = SvgPreserveAspectRatioType.XMidYMid; _isDefaultAlign = true; } if (match.Groups["meet"].Success) { _isDefaultAlign = false; switch (match.Groups["meet"].Value) { case "slice": _meetOrSlice = SvgMeetOrSlice.Slice; break; case "meet": _meetOrSlice = SvgMeetOrSlice.Meet; break; case "": _meetOrSlice = SvgMeetOrSlice.Meet; break; default: _meetOrSlice = SvgMeetOrSlice.Unknown; break; } } else { _meetOrSlice = SvgMeetOrSlice.Meet; } }
public SvgMarkerGraphicsNode(SvgElement element) : base(element) { }
public SvgUriReference(SvgElement ownerElement) { this.ownerElement = ownerElement; this.ownerElement.attributeChangeHandler += new NodeChangeHandler(AttributeChange); }
public GdiRendering(SvgElement element) : base(element) { _uniqueColor = Color.Empty; }
public SvgLength(SvgElement ownerElement, string propertyName, SvgLengthDirection direction, string baseVal) : this(ownerElement, propertyName, direction, baseVal, String.Empty) { }
protected GdiRenderingBase(SvgElement element) { this.element = element; this.screenRegion = SvgRectF.Empty; }
public SvgAnimatedLengthList(string propertyName, string str, SvgElement ownerElement, SvgLengthDirection direction) { baseVal = new SvgLengthList(propertyName, str, ownerElement, direction); animVal = baseVal; }
public SvgAnimatedPreserveAspectRatio(string attr, SvgElement ownerElement) { _baseVal = new SvgPreserveAspectRatio(attr, ownerElement); _animVal = _baseVal; }
protected WpfRenderingBase(SvgElement element) { this._svgElement = element; }
/// <summary> /// Used for attributes of basic type 'length' which can be animated. /// </summary> /// <param name="ownerElement">The elements that contains the length</param> /// <param name="direction">The direction of the length, 0=x-axis, 1=y-axis, 2=no special axis</param> /// <param name="defaultValue">String to parse for the value</param> public SvgAnimatedLength(SvgElement ownerElement, string propertyName, SvgLengthDirection direction, string defaultValue) { _baseVal = new SvgLength(ownerElement, propertyName, SvgLengthSource.Xml, direction, defaultValue); }
public GdiPathRendering(SvgElement element) : base(element) { }
public GraphicsNode(SvgElement element) : base(element) { }
public GdiImageRendering(SvgElement element) : base(element) { }
public SvgURIReference(SvgElement ownerElement) { this.ownerElement = ownerElement; this.ownerElement.attributeChangeHandler += new NodeChangeHandler(AttributeChange); }