Exemple #1
0
        void DrawBubble(Report rpt, Graphics g, Brush brush, Point p, int iRow, int iCol, double bmin, double bmax, double bv, double xv, double yv)
        {
            Pen pen      = null;
            int diameter = BubbleSize(rpt, iRow, iCol, bmin, bmax, bv);          // set diameter of bubble

            int radius = diameter / 2;

            try
            {
                if (this.ChartDefn.Type == ChartTypeEnum.Scatter &&
                    brush.GetType() == typeof(System.DrawingCore.Drawing2D.HatchBrush))
                {
                    System.DrawingCore.Drawing2D.HatchBrush tmpBrush = (System.DrawingCore.Drawing2D.HatchBrush)brush;
                    SolidBrush br = new SolidBrush(tmpBrush.ForegroundColor);
                    pen = new Pen(new SolidBrush(tmpBrush.ForegroundColor));
                    DrawLegendMarker(g, br, pen, SeriesMarker[iCol - 1], p.X - radius, p.Y - radius, diameter);
                    DrawDataPoint(rpt, g, new Point(p.X - 3, p.Y + 3), iRow, iCol);
                }
                else
                {
                    pen = new Pen(brush);
                    DrawLegendMarker(g, brush, pen, ChartMarkerEnum.Bubble, p.X - radius, p.Y - radius, diameter);
                    DrawDataPoint(rpt, g, new Point(p.X - 3, p.Y + 3), iRow, iCol);
                }
                //Add a metafilecomment to use as a tooltip GJL 26092008

                if (_showToolTips || _showToolTipsX)
                {
                    string display = "";
                    if (_showToolTipsX)
                    {
                        display = xv.ToString(_tooltipXFormat);
                    }
                    if (_showToolTips)
                    {
                        if (display.Length > 0)
                        {
                            display += " , ";
                        }
                        display += yv.ToString(_tooltipYFormat);
                    }
                    String val = "ToolTip:" + display + "|X:" + (int)(p.X - 3) + "|Y:" + (int)(p.Y - 3) + "|W:" + 6 + "|H:" + 6;
                    g.AddMetafileComment(new System.Text.ASCIIEncoding().GetBytes(val));
                }
            }
            finally
            {
                if (pen != null)
                {
                    pen.Dispose();
                }
            }

            return;
        }
Exemple #2
0
        public EmfHatchFillBrush(BinaryReader _br)
        {
            Int32 HatchStyle = _br.ReadInt32();

            byte fA, fR, fG, fB;

            fB = _br.ReadByte();
            fG = _br.ReadByte();
            fR = _br.ReadByte();
            fA = _br.ReadByte();

            byte bA, bR, bG, bB;

            bB = _br.ReadByte();
            bG = _br.ReadByte();
            bR = _br.ReadByte();
            bA = _br.ReadByte();

            myBrush = new System.DrawingCore.Drawing2D.HatchBrush((System.DrawingCore.Drawing2D.HatchStyle)HatchStyle, Color.FromArgb(fA, fR, fG, fB), Color.FromArgb(bA, bR, bG, bB));
        }
Exemple #3
0
        void DrawLineBetweenPoints(Graphics g, Report rpt, Brush brush, Point[] points, int intLineSize)
        {
            if (points.Length <= 1)             // Need at least 2 points
            {
                return;
            }

            Pen p = null;

            try
            {
                if (brush.GetType() == typeof(System.DrawingCore.Drawing2D.HatchBrush))
                {
                    System.DrawingCore.Drawing2D.HatchBrush tmpBrush = (System.DrawingCore.Drawing2D.HatchBrush)brush;
                    p = new Pen(new SolidBrush(tmpBrush.ForegroundColor), intLineSize); //1.5F);    // todo - use line from style ????
                }
                else
                {
                    p = new Pen(brush, intLineSize);
                }

                if ((ChartSubTypeEnum)Enum.Parse(typeof(ChartSubTypeEnum), _ChartDefn.Subtype.EvaluateString(rpt, _row)) == ChartSubTypeEnum.Smooth && points.Length > 2)
                {
                    g.DrawCurve(p, points, 0.5F);
                }
                else
                {
                    g.DrawLines(p, points);
                }
            }
            finally
            {
                if (p != null)
                {
                    p.Dispose();
                }
            }
            return;
        }