Ejemplo n.º 1
0
            public void OnPaintVertical(PaintEventArgsI e, int xdist, int ydist, int width, int height, float centerx, float centery)
            {
                bounds.X      = width / 2 + width / xdist * (x - centerx) - icosize / 2;
                bounds.Y      = height / 2 - height / ydist * (z - centery) - icosize / 2;
                bounds.Width  = icosize;
                bounds.Height = icosize;


                e.Graphics.DrawPie(new Pen(Color), bounds, 0, 359);

                e.Graphics.DrawString(Name, SystemFonts.DefaultFont, Brushes.Red, bounds.Right, bounds.Top,
                                      StringFormat.GenericDefault);
                //e.Graphics.DrawString(z.ToString(), SystemFonts.DefaultFont, Brushes.Red, bounds.Right, bounds.Bottom, StringFormat.GenericDefault);
                // e.ClipRectangle.Width / 2 + e.ClipRectangle.Width / xdist * x - icosize / 2, e.ClipRectangle.Height / 2 + e.ClipRectangle.Height / ydist * y - icosize / 2, icosize, icosize
            }
Ejemplo n.º 2
0
        void OnPaint(PaintEventArgsI e)
        {
            xline = (this.Width - 1) / (float)xdist;

            yline = (this.Height - 1) / (float)ydist;

            var pen = new Pen(Color.Silver);

            pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;

            if (BGImage != null)
            {
                e.Graphics.DrawImage(BGImage, BGImagex * xline, BGImagey * yline, BGImagew * xline, BGImageh * yline);
            }

            //lines
            for (float x = 0; x <= xdist; x++)
            {
                // middle
                if (x == xdist / 2)
                {
                }
                else if (x % 2 == 0)
                {
                    e.Graphics.DrawLine(Pens.Silver, x * xline, 0, x * xline, this.Height);
                }
                else
                {
                    e.Graphics.DrawLine(pen, x * xline, 0, x * xline, this.Height);
                }
            }

            for (float y = 0; y <= ydist; y++)
            {
                // middle
                if (y == ydist / 2.0f)
                {
                }
                else if (y % 2 == 0)
                {
                    e.Graphics.DrawLine(Pens.Silver, 0, y * yline, this.Width, y * yline);
                }
                else
                {
                    e.Graphics.DrawLine(pen, 0, y * yline, this.Width, y * yline);
                }
            }

            // draw the middle lines
            e.Graphics.DrawLine(Pens.Green, xdist / 2 * xline, 0, xdist / 2 * xline, this.Height);
            e.Graphics.DrawLine(Pens.Green, 0, ydist / 2 * yline, this.Width, ydist / 2 * yline);

            //text
            for (float x = 1; x <= xdist; x++)
            {
                if (x % 2 == 0)
                {
                    e.Graphics.DrawString(((xdist / -2) + x + centerx).ToString("0.0"), SystemFonts.DefaultFont, Brushes.Red, x * xline,
                                          0.0f, StringFormat.GenericDefault);
                }
            }

            for (float y = 0; y <= ydist; y++)
            {
                if (y % 2 == 0)
                {
                    e.Graphics.DrawString((((ydist / -2) + y - centery) * -1).ToString("0.0"), SystemFonts.DefaultFont, Brushes.Red, 0.0f,
                                          y * yline, StringFormat.GenericDefault);
                }
            }

            //icons
            foreach (icon ico in icons)
            {
                //if (ico.interf.parent.BaseStream.IsOpen)
                {
                    if (Vertical)
                    {
                        ico.OnPaintVertical(e, xdist, ydist, this.Width, this.Height, centerx, centery);
                    }
                    else
                    {
                        ico.OnPaint(e, xdist, ydist, this.Width, this.Height, centerx, centery);
                    }
                }
            }

            //
            if (mouseover != null)
            {
                mouseover.MouseOver(e);
            }
        }
Ejemplo n.º 3
0
 public void MouseOver(PaintEventArgsI e)
 {
 }