SharpVectors.Dom.Svg.SvgRect.SvgRect C# (CSharp) Method

SvgRect() public method

public SvgRect ( string str ) : System
str string
return System
        public SvgRect(string str)
        {
            string replacedStr = Regex.Replace(str, @"(\s|,)+", ",");
            string[] tokens = replacedStr.Split(new char[]{','});
            if(tokens.Length == 4)
            {
                this.x = SvgNumber.ParseToFloat(tokens[0]);
                this.y = SvgNumber.ParseToFloat(tokens[1]);
                this.width = SvgNumber.ParseToFloat(tokens[2]);
                this.height = SvgNumber.ParseToFloat(tokens[3]);
            }
            else
            {
                throw new SvgException(SvgExceptionType.SvgInvalidValueErr, "Invalid SvgRect value: " + str);
            }
        }

Same methods

SvgRect::SvgRect ( RectangleF rect ) : System
SvgRect::SvgRect ( double x, double y, double width, double height ) : System