Ejemplo n.º 1
0
        private void DrawOutline(Rectangle prevRect, Rectangle curRect)
        {
            prevRect = Conversion.ChildToParent(prevRect, Chart.ClientRect);
            curRect  = Conversion.ChildToParent(curRect, Chart.ClientRect);
            var rect       = new Rectangle(prevRect.Left, prevRect.Bottom - 2, prevRect.Width, 4);
            var rectangle2 = new Rectangle(curRect.Left, curRect.Bottom - 2, curRect.Width, 4);

            _backBuffer.Render(_frontBuffer, rect);
            _frontBuffer.Graphics.DrawLine(_pen, curRect.Left, curRect.Bottom, curRect.Right, curRect.Bottom);
            _frontBuffer.Render(_screenGraphics, rect);
            _frontBuffer.Render(_screenGraphics, rectangle2);
        }
Ejemplo n.º 2
0
        private void DrawImage(Point previousLoc, Point currentLoc)
        {
            Rectangle srcRect = Conversion.ChildToParent(CurrentPane.Bounds, Chart.ClientRect);
            int       num     = currentLoc.Y - _startLoc.Y;
            int       x       = currentLoc.X - _startLoc.X;
            var       rect    = new Rectangle(x, CurrentPane.Top + num, CurrentPane.Width, CurrentPane.Height);

            rect = Conversion.ChildToParent(rect, Chart.ClientRect);
            num  = previousLoc.Y - _startLoc.Y;
            x    = previousLoc.X - _startLoc.X;
            var rectangle3 = new Rectangle(x, CurrentPane.Top + num, CurrentPane.Width, CurrentPane.Height);

            rectangle3            = Conversion.ChildToParent(rectangle3, Chart.ClientRect);
            _colorMatrix.Matrix33 = Opacity;
            _imageAttr.SetColorMatrix(_colorMatrix);
            _backBuffer.Render(_frontBuffer, rectangle3);
            _backBuffer.Render(_frontBuffer, srcRect, rect, _imageAttr);
            _frontBuffer.Render(_screenGraphics, Rectangle.Union(rect, rectangle3));
        }
Ejemplo n.º 3
0
        private void DrawSelection(Point previousLoc, Point currentLoc)
        {
            Point point = CurrentPane.ClientToChart(_startLoc);

            previousLoc = CurrentPane.ClientToChart(previousLoc);
            currentLoc  = CurrentPane.ClientToChart(currentLoc);
            Rectangle rectangle  = CurrentPane.ClientToChart(CurrentPane.CanvasRect);
            Rectangle rectangle2 = previousLoc.X > point.X
                                       ? new Rectangle(point.X, rectangle.Y, (previousLoc.X - point.X) + 1, rectangle.Height)
                                       : new Rectangle(previousLoc.X, rectangle.Y, (point.X - previousLoc.X) + 1, rectangle.Height);
            Rectangle rectangle3 = currentLoc.X > point.X
                                       ? new Rectangle(point.X, rectangle.Y, (currentLoc.X - point.X) + 1, rectangle.Height)
                                       : new Rectangle(currentLoc.X, rectangle.Y, (point.X - currentLoc.X) + 1, rectangle.Height);

            backBuffer.Render(frontBuffer, rectangle2);
            frontBuffer.Graphics.FillRectangle(brush, rectangle3);
            frontBuffer.Graphics.DrawLine(pen, rectangle3.Left, rectangle3.Top, rectangle3.Left, rectangle3.Bottom);
            if (rectangle3.Width > 0)
            {
                frontBuffer.Graphics.DrawLine(pen, rectangle3.Right - 1, rectangle3.Top, rectangle3.Right - 1,
                                              rectangle3.Bottom);
            }
            frontBuffer.Render(screenGraphics, Rectangle.Union(rectangle2, rectangle3));
        }