public SvgAnimatedNumberList() { _baseVal = new SvgNumberList(); _animVal = _baseVal; }
public SvgAnimatedNumberList(string str) { _baseVal = new SvgNumberList(str); _animVal = _baseVal; }
public SvgAnimatedNumberList(string str) { baseVal = new SvgNumberList(str); animVal = baseVal; }
private DoubleCollection GetDashArray(double strokeWidth) { string dashArrayText = _element.GetPropertyValue("stroke-dasharray"); if (String.IsNullOrEmpty(dashArrayText)) { return null; } if (dashArrayText == "none") { return null; } else { SvgNumberList list = new SvgNumberList(dashArrayText); uint len = list.NumberOfItems; //float[] fDashArray = new float[len]; DoubleCollection dashArray = new DoubleCollection((int)len); for (uint i = 0; i < len; i++) { //divide by strokeWidth to take care of the difference between Svg and WPF dashArray.Add(list.GetItem(i).Value / strokeWidth); } return dashArray; } }
public SvgNumberListEnumerator(SvgNumberList list) : base(list) { }
private float[] getDashArray(float strokeWidth) { string dashArray = _element.GetPropertyValue("stroke-dasharray"); if(dashArray.Length == 0 || dashArray == "none") { return null; } else { SvgNumberList list = new SvgNumberList(dashArray); uint len = list.NumberOfItems; float[] fDashArray = new float[len]; for(uint i = 0; i<len; i++) { //divide by strokeWidth to take care of the difference between Svg and GDI+ fDashArray[i] = list.GetItem(i).Value / strokeWidth; } if(len % 2 == 1) { //odd number of values, duplicate float[] tmpArray = new float[len*2]; fDashArray.CopyTo(tmpArray, 0); fDashArray.CopyTo(tmpArray, (int)len); fDashArray = tmpArray; } return fDashArray; } }