NewValueSpecifiedUnits() public method

public NewValueSpecifiedUnits ( float valueInSpecifiedUnits ) : void
valueInSpecifiedUnits float
return void
Ejemplo n.º 1
0
    /***********************************************************************************/
    //Khoi tao
    private void Initialize(AttributeList attrList)
    {
        isStrokeWidth = false;

        if (attrList.GetValue("fill").IndexOf("url") >= 0)
        {
            _gradientID = SVGStringExtractor.ExtractUrl4Gradient(attrList.GetValue("fill"));
        }
        else
        {
            _fillColor = new SVGColor(attrList.GetValue("fill"));
        }
        _strokeColor = new SVGColor(attrList.GetValue("stroke"));

        if (attrList.GetValue("stroke-width") != "")
        {
            isStrokeWidth = true;
        }
        _strokeWidth = new SVGLength(attrList.GetValue("stroke-width"));


        SetStrokeLineCap(attrList.GetValue("stroke-linecap"));
        SetStrokeLineJoin(attrList.GetValue("stroke-linejoin"));

        if (attrList.GetValue("stroke-width") == "")
        {
            _strokeWidth.NewValueSpecifiedUnits(1f);
        }
        Style(attrList.GetValue("style"));
        //style="fill: #ffffff; stroke:#000000; stroke-width:0.172"
    }
Ejemplo n.º 2
0
    public SVGPaintable(SVGPaintable inheritPaintable, Dictionary <string, string> attrList)
    {
        _linearGradList = inheritPaintable.linearGradList;
        _radialGradList = inheritPaintable.radialGradList;
        Initialize(attrList);

        if (IsFillX() == false)
        {
            if (inheritPaintable.IsLinearGradiantFill())
            {
                _gradientID = inheritPaintable.gradientID;
            }
            else if (inheritPaintable.IsRadialGradiantFill())
            {
                _gradientID = inheritPaintable.gradientID;
            }
            else
            {
                _fillColor = inheritPaintable.fillColor;
            }
        }
        if (!IsStroke() && inheritPaintable.IsStroke())
        {
            _strokeColor = inheritPaintable.strokeColor;
        }

        if (_strokeLineCap == SVGStrokeLineCapMethod.Unknown)
        {
            _strokeLineCap = inheritPaintable.strokeLineCap;
        }

        if (_strokeLineJoin == SVGStrokeLineJoinMethod.Unknown)
        {
            _strokeLineJoin = inheritPaintable.strokeLineJoin;
        }

        if (isStrokeWidth == false)
        {
            _strokeWidth.NewValueSpecifiedUnits(inheritPaintable.strokeWidth);
        }
    }
Ejemplo n.º 3
0
    /***********************************************************************************/
    //Khoi tao
    private void Initialize(AttributeList attrList)
    {
        isStrokeWidth = false;

        if(attrList.GetValue("fill").IndexOf("url") >= 0) {
          _gradientID = SVGStringExtractor.ExtractUrl4Gradient(attrList.GetValue("fill"));
        } else {
          _fillColor = new SVGColor(attrList.GetValue("fill"));
        }
        _strokeColor = new SVGColor(attrList.GetValue("stroke"));

        if(attrList.GetValue("stroke-width") != "") isStrokeWidth = true;
        _strokeWidth = new SVGLength(attrList.GetValue("stroke-width"));

        SetStrokeLineCap(attrList.GetValue("stroke-linecap"));
        SetStrokeLineJoin(attrList.GetValue("stroke-linejoin"));

        if(attrList.GetValue("stroke-width") == "") _strokeWidth.NewValueSpecifiedUnits(1f);
        Style(attrList.GetValue("style"));
        //style="fill: #ffffff; stroke:#000000; stroke-width:0.172"
    }