Esempio n. 1
0
        public void DrawPolygon(int layerHandle, ref object xPoints, ref object yPoints, int numPoints, Color color,
                                bool fill, short width)
        {
            object x = xPoints;
            object y = yPoints;

            _map.DrawWidePolygonEx(layerHandle, ref x, ref y, numPoints, ColorHelper.ColorToUInt(color), fill, width, color.A);
        }
Esempio n. 2
0
        public bool SetUpFrame()
        {
            double[] x = new double[5];
            double[] y = new double[5];
            switch (MapLegendPosition)
            {
            case MapLegendPosition.PositionFromCorner:
                switch (LegendCornerPosition)
                {
                case "topLeft":
                    x[0] = LegendAnchorCorner.x;
                    y[0] = LegendAnchorCorner.y;

                    x[1] = LegendAnchorCorner.x + Width;
                    y[1] = LegendAnchorCorner.y;

                    x[2] = LegendAnchorCorner.x + Width;
                    y[2] = LegendAnchorCorner.y + 100;

                    x[3] = LegendAnchorCorner.x;
                    y[3] = LegendAnchorCorner.y + 100;

                    x[4] = LegendAnchorCorner.x;
                    y[4] = LegendAnchorCorner.y;
                    break;

                case "topRight":

                    break;

                case "bottomLeft":

                    break;

                case "bottomRight":

                    break;
                }
                break;

            case MapLegendPosition.PositionFromDefinedExtent:
                break;
            }
            object xObj = x;
            object yObj = y;

            _mapControl.DrawWidePolygonEx(_hLegend, ref xObj, ref yObj, 5, new Utils().ColorByName(tkMapColor.White), true, 2);
            _mapControl.DrawWidePolygonEx(_hLegend, ref xObj, ref yObj, 5, BorderColor, false, 2);
            MapWinGIS.Point topLeft = GetFrameTopLeft(y, x);

            var lbls = _mapControl.get_DrawingLabels(_hLegend);
            var cat  = lbls.AddCategory("Legend");

            cat.FontBold     = true;
            cat.FrameVisible = false;
            cat.FontSize     = 12;
            cat.Alignment    = tkLabelAlignment.laCenterRight;
            if (lbls != null)
            {
                lbls.AddLabel(Caption, topLeft.x + Padding, topLeft.y + Padding, 0, 0);
            }

            return(x.Length > 0 && y.Length > 0);
        }