Example #1
0
        private void UpdateStrokeColor(SvgLib.SvgElement el, ColorManagement colorManagement)
        {
            if (el is SvgLib.SvgCircle || el is SvgLib.SvgEllipse || el is SvgLib.SvgLine || el is SvgLib.SvgPath || el is SvgLib.SvgPolygon || el is SvgLib.SvgPolyline || el is SvgLib.SvgRectangle)
            {
                var stroke = (el as SvgLib.SvgVisualElement).Stroke;
                if (stroke != null)
                {
                    System.Drawing.Color color;
                    if (StrokeColor is RgbColor)
                    {
                        color = StrokeColor.ToGdiPlusColor();
                    }
                    else
                    {
                        colorManagement = colorManagement ?? GetColorManagement(true);
                        color           = ColorManagement.GetPreviewColor(colorManagement, _strokeColor);
                    }

                    (stroke as SvgLib.SvgColourServer).Colour = color;
                }
            }

            if (el.HasChildren())
            {
                foreach (var ch in el.Children)
                {
                    UpdateStrokeColor(ch, colorManagement);
                }
            }
        }
        internal string GetMD5(float dpi)
        {
            var bytes = GetBytes();

            bytes.AddRange(BitConverter.GetBytes(dpi));

            var color = ColorManagement.GetPreviewColor(GetColorManagement(true), TextColor);

            bytes.AddRange(BitConverter.GetBytes(color.ToInt32()));

            if (TargetDpi.HasValue)
            {
                bytes.AddRange(BitConverter.GetBytes(TargetDpi.Value));
            }

            return(AjaxControls.Common.CalculateMD5(bytes.ToArray()));
        }