Example #1
0
        public LinePos[] GetRectLinePos(int startRowIdx, int startColIdx, int endRowIdx, int endColIdx)
        {
            RectangleF rect = GetRect(startRowIdx, startColIdx, endRowIdx, endColIdx);

            LinePos[] linePosList = new LinePos[4];

            //
            LinePos linePos = new LinePos();

            linePos.start  = new PointF(rect.Left, rect.Top);
            linePos.end    = new PointF(rect.Left, rect.Bottom);
            linePosList[0] = linePos;

            //
            linePos        = new LinePos();
            linePos.start  = new PointF(rect.Left, rect.Top);
            linePos.end    = new PointF(rect.Right, rect.Top);
            linePosList[1] = linePos;

            //
            linePos        = new LinePos();
            linePos.start  = new PointF(rect.Right, rect.Top);
            linePos.end    = new PointF(rect.Right, rect.Bottom);
            linePosList[2] = linePos;


            //
            linePos        = new LinePos();
            linePos.start  = new PointF(rect.Left, rect.Bottom);
            linePos.end    = new PointF(rect.Right, rect.Bottom);
            linePosList[3] = linePos;

            return(linePosList);
        }
Example #2
0
        public LinePos GetColLinePos(int colIdx, DirectionMode dir = DirectionMode.BOTTOM_OR_RIGHT)
        {
            RectangleF rect = GetOriginalCellRect(0, colIdx);

            LinePos linePos = new LinePos();
            PointF  start, end;

            if (dir == DirectionMode.UP_OR_LEFT)
            {
                start = new PointF(rect.Left, rect.Top);
                end   = new PointF(rect.Left, rect.Top + tbHeight);
            }
            else
            {
                start = new PointF(rect.Right, rect.Top);
                end   = new PointF(rect.Right, rect.Top + tbHeight);
            }

            linePos.start = start;
            linePos.end   = end;
            return(linePos);
        }
Example #3
0
        public LinePos GetRowLinePos(int rowIdx, DirectionMode dir = DirectionMode.BOTTOM_OR_RIGHT)
        {
            RectangleF rect = GetOriginalCellRect(rowIdx, 0);

            LinePos linePos = new LinePos();
            PointF  start, end;

            if (dir == DirectionMode.UP_OR_LEFT)
            {
                start = new PointF(rect.Left, rect.Top);
                end   = new PointF(rect.Left + tbWidth, rect.Top);
            }
            else
            {
                start = new PointF(rect.Left, rect.Bottom);
                end   = new PointF(rect.Left + tbWidth, rect.Bottom);
            }

            linePos.start = start;
            linePos.end   = end;
            return(linePos);
        }