Esempio n. 1
0
        public static Image GetSymbol(MapPointShape shape, int size, System.Windows.Media.Color fill, bool drawOutline, System.Windows.Media.Color outline = default(System.Windows.Media.Color))
        {
            Color fillColor = Color.FromArgb(fill.A, fill.R, fill.G, fill.B);

            if (outline == default(System.Windows.Media.Color)) {
                outline = System.Windows.Media.Colors.Black;
            }

            Color outlineColor = Color.FromArgb(outline.A, outline.R, outline.G, outline.B);

            Image img = null;

            switch (shape) {
                case MapPointShape.Circle:
                    img = Circle(size, fillColor, drawOutline, outlineColor);
                    break;
                case MapPointShape.Square:
                    img = Square(size, fillColor, drawOutline, outlineColor);
                    break;
                case MapPointShape.Triangle:
                    img = Triangle(size, fillColor, drawOutline, outlineColor);
                    break;
            }

            if (img != null) {
                var info = new SymbolInfo { Size = size, Color = fillColor, DrawOutline = drawOutline, Shape = shape };
                img.Tag = info;
            }

            return img;
        }
        public static Image GetSymbol(MapPointShape shape, int size, System.Windows.Media.Color fill, bool drawOutline, System.Windows.Media.Color outline = default(System.Windows.Media.Color))
        {
            Color fillColor = Color.FromArgb(fill.A, fill.R, fill.G, fill.B);

            if (outline == default(System.Windows.Media.Color))
            {
                outline = System.Windows.Media.Colors.Black;
            }

            Color outlineColor = Color.FromArgb(outline.A, outline.R, outline.G, outline.B);

            Image img = null;

            switch (shape)
            {
            case MapPointShape.Circle:
                img = Circle(size, fillColor, drawOutline, outlineColor);
                break;

            case MapPointShape.Square:
                img = Square(size, fillColor, drawOutline, outlineColor);
                break;

            case MapPointShape.Triangle:
                img = Triangle(size, fillColor, drawOutline, outlineColor);
                break;
            }

            if (img != null)
            {
                var info = new SymbolInfo {
                    Size = size, Color = fillColor, DrawOutline = drawOutline, Shape = shape
                };
                img.Tag = info;
            }

            return(img);
        }
 public PointShapeViewModel(MapPointShape shape)
 {
     Shape = shape;
     Icon  = GraphicsUtils.SystemDrawingImageToBitmapSource(MapSymbolGenerator.GetSymbol(shape, 10, Colors.Black, true));
 }
Esempio n. 4
0
 public PointShapeViewModel(MapPointShape shape)
 {
     Shape = shape;
     Icon = GraphicsUtils.SystemDrawingImageToBitmapSource(MapSymbolGenerator.GetSymbol(shape, 10, Colors.Black, true));
 }