MapAround.Mapping.MapWorkspace.addPointStyleElement C# (CSharp) Method

addPointStyleElement() private method

private addPointStyleElement ( PointStyle PointStyle, XmlDocument doc, XmlElement layerElement ) : void
PointStyle PointStyle
doc System.Xml.XmlDocument
layerElement System.Xml.XmlElement
return void
        private void addPointStyleElement(PointStyle PointStyle, XmlDocument doc, XmlElement layerElement)
        {
            XmlElement pointStyleElement = doc.CreateElement("point_style");
            layerElement.AppendChild(pointStyleElement);
            addAttribute(doc, pointStyleElement, "display_kind", ((int)PointStyle.DisplayKind).ToString(CultureInfo.InvariantCulture));
            addAttribute(doc, pointStyleElement, "color", ColorTranslator.ToHtml(PointStyle.Color));
            addAttribute(doc, pointStyleElement, "size", PointStyle.Size.ToString(CultureInfo.InvariantCulture));
            addAttribute(doc, pointStyleElement, "symbol", PointStyle.Symbol.ToString(CultureInfo.InvariantCulture));
            addAttribute(doc, pointStyleElement, "font_name", PointStyle.FontName);
            addAttribute(doc,pointStyleElement, "contentAlignment", PointStyle.ContentAlignment.ToString());

            if (PointStyle.Image != null)
            {
                using (MemoryStream ms = new MemoryStream())
                {
                    PointStyle.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                    ms.Close();
                    string pngStr = System.Convert.ToBase64String(ms.ToArray());
                    addAttribute(doc, pointStyleElement, "bitmap", pngStr);
                }
            }
        }