SuperImageEvolver.Shape.SerializeSVG C# (CSharp) Méthode

SerializeSVG() public méthode

public SerializeSVG ( System.Xml.Linq.XNamespace xmlns ) : System.Xml.Linq.XElement
xmlns System.Xml.Linq.XNamespace
Résultat System.Xml.Linq.XElement
        public XElement SerializeSVG( XNamespace xmlns )
        {
            XElement el = new XElement( xmlns + "polygon" );
            StringBuilder sb = new StringBuilder();
            foreach( PointF point in Points ) {
                sb.AppendFormat( "{0} {1} ", point.X, point.Y );
            }
            el.Add( new XAttribute( "points", sb.ToString() ) );
            el.Add( new XAttribute( "fill", String.Format( "rgb({0},{1},{2})", Color.R, Color.G, Color.B ) ) );
            el.Add( new XAttribute( "opacity", Color.A / 255f ) );
            return el;
        }