예제 #1
0
        private static void DrawNormalStyle(this Style style, PlatformGeoCanvas canvas, DrawingRectangleF drawingRectangleF)
        {
            if (style is LineStyle)
            {
                LineStyle lineStyle = (LineStyle)style;

                if (lineStyle.CenterPen.Width <= 2 && lineStyle.InnerPen.Width <= 2 && lineStyle.OuterPen.Width <= 2)
                {
                    lineStyle = (LineStyle)lineStyle.CloneDeep();

                    lineStyle.CenterPen.Width += 1;
                    lineStyle.InnerPen.Width  += 1;
                    lineStyle.OuterPen.Width  += 1;

                    LineShape line = GenerateStraightHorizontalLineShape(canvas.CurrentWorldExtent);
                    line.Rotate(line.GetCenterPoint(), 270);
                    lineStyle.Draw(new BaseShape[] { line }, canvas, new Collection <SimpleCandidate>(), new Collection <SimpleCandidate>());
                }
                else
                {
                    lineStyle.DrawSample(canvas, drawingRectangleF);
                }
            }
            else if (style is FontPointStyle)
            {
                var fontStyle = (FontPointStyle)style;
                var tmpsize   = fontStyle.CharacterFont.Size;
                if (tmpsize > 26)
                {
                    fontStyle.CharacterFont = new GeoFont(fontStyle.CharacterFont.FontName, 26, fontStyle.CharacterFont.Style);
                }
                fontStyle.DrawSample(canvas, drawingRectangleF);
                if (tmpsize > 26)
                {
                    fontStyle.CharacterFont = new GeoFont(fontStyle.CharacterFont.FontName, tmpsize, fontStyle.CharacterFont.Style);
                }
            }
            else if (style is PointStyle)
            {
                var pointStyle    = (PointStyle)style;
                var tmpSymbolSize = pointStyle.SymbolSize;
                if (tmpSymbolSize > 22)
                {
                    pointStyle.SymbolSize = 22;
                }
                pointStyle.DrawSample(canvas, drawingRectangleF);
                if (tmpSymbolSize > 22)
                {
                    pointStyle.SymbolSize = tmpSymbolSize;
                }
            }
            else if (style != null)
            {
                style.DrawSample(canvas, drawingRectangleF);
            }
        }
예제 #2
0
        private void SetBounds(FpSpread fpSpread, LineShape lineShape)
        {
            Rectangle startCellRectangle = GetCellRectangle(fpSpread, startCellRow + rowOffset, startCellColumn);
            Rectangle endCellRectangle   = GetCellRectangle(fpSpread, endCellRow + rowOffset, endCellColumn);
            int       x      = startCellRectangle.X;
            int       y      = startCellRectangle.Y;
            int       width  = endCellRectangle.Right - startCellRectangle.Left;
            int       height = endCellRectangle.Bottom - startCellRectangle.Top;

            lineShape.SetBounds(x, y, width, height);
            if (bevelLineType == BevelLineType.Up)
            {
                lineShape.SetBounds(x, y + height, width, height);
                float  tan    = (float)height / (float)width;
                double rotate = Math.Atan2(height, width) * 180 / Math.PI;
                lineShape.Rotate(lineShape.Location, -2 * (float)rotate);
            }
        }