Пример #1
0
        protected override void OnPaintBackground(PaintEventArgs e)
        {
            Graphics       g      = e.Graphics;
            GraphicsHelper helper = new GraphicsHelper(g);

            g.Clear(this.BackColor);

            Rectangle    bounds = new Rectangle((TerminalGlowIntensity + 1) / 2, (TerminalGlowIntensity + 1) / 2, Width - (TerminalGlowIntensity + 1), Height - (TerminalGlowIntensity + 1));
            GraphicsPath gp1    = helper.CreateRoundedPath(bounds, 3);

            if (perlin == null)
            {
                perlin = new PerlinNoise(Width, Height).Generate() as PerlinNoise;
            }

            Brush b1 = new LinearGradientBrush(bounds, Color.FromArgb(197, 197, 197), Color.FromArgb(205, 205, 205), 90);
            Brush b2 = new SolidBrush(Color.FromArgb(251, 251, 251));
            Brush b3 = new HatchBrush(HatchStyle.OutlinedDiamond, Color.FromArgb(10, Color.Black), Color.Transparent);
            Pen   p  = new Pen(b1);

            g.DrawGlow(gp1, Color.SkyBlue, GlowIntensity, GlowFeather);

            g.FillPath(b2, gp1);
            g.DrawPath(p, gp1);
            g.FillPath(perlin.NoiseMap, 1f, gp1);
            g.FillPath(b3, gp1);
            g.DrawImage(perlin.NoiseMap, new Rectangle(0, 0, perlin.NoiseMap.Width, perlin.NoiseMap.Height));
        }
Пример #2
0
        protected override void OnPaint(PaintEventArgs e)
        {
            Graphics       g      = e.Graphics;
            GraphicsHelper helper = new GraphicsHelper(g);

            g.Clear(Parent.BackColor);
            g.SmoothingMode = SmoothingMode.AntiAlias;

            Rectangle box = new Rectangle(0, 0, 15, 15);

            GraphicsPath gp1 = helper.CreateRoundedPath(box, 3);

            GraphicsPath pathCheck = new GraphicsPath();

            pathCheck.AddLine(0, 4, 1, 4);
            pathCheck.AddLine(1, 4, 4, 7);
            pathCheck.AddLine(4, 7, 11, 0);
            pathCheck.AddLine(11, 0, 12, 1);
            pathCheck.AddLine(12, 1, 4, 9);
            pathCheck.AddLine(4, 9, 0, 5);
            pathCheck.AddLine(0, 5, 0, 4);
            pathCheck.AddLine(0, 4, 4, 8);
            pathCheck.AddLine(4, 8, 11, 1);

            Pen   p1 = new Pen(Color.FromArgb(209, 209, 209));
            Pen   p2 = new Pen(Color.FromArgb(68, 110, 175));
            Pen   p3 = new Pen(Color.FromArgb(88, 160, 215));
            Brush b1 = new SolidBrush(Color.FromArgb(233, 233, 233));

            g.FillPath(b1, gp1);
            g.DrawPath(p1, gp1);

            if (this.Checked)
            {
                g.DrawPath(p3, pathCheck, 2, 3);
            }

            g.DrawString(this.Text, this.Font, Brushes.Black, new PointF(box.X + box.Width + 3, box.Y + 2));
        }
Пример #3
0
		protected override void OnPaintBackground(PaintEventArgs e) {
			Graphics g = e.Graphics;
			GraphicsHelper helper = new GraphicsHelper(g);

			g.Clear(this.BackColor);

			Rectangle bounds = new Rectangle((TerminalGlowIntensity + 1) / 2, (TerminalGlowIntensity + 1) / 2, Width - (TerminalGlowIntensity + 1), Height - (TerminalGlowIntensity + 1));
			GraphicsPath gp1 = helper.CreateRoundedPath(bounds, 3);

			if (perlin == null) perlin = new PerlinNoise(Width, Height).Generate() as PerlinNoise;

			Brush b1 = new LinearGradientBrush(bounds, Color.FromArgb(197, 197, 197), Color.FromArgb(205, 205, 205), 90);
			Brush b2 = new SolidBrush(Color.FromArgb(251, 251, 251));
			Brush b3 = new HatchBrush(HatchStyle.OutlinedDiamond, Color.FromArgb(10, Color.Black), Color.Transparent);
			Pen p = new Pen(b1);

			g.DrawGlow(gp1, Color.SkyBlue, GlowIntensity, GlowFeather);

			g.FillPath(b2, gp1);
			g.DrawPath(p, gp1);
			g.FillPath(perlin.NoiseMap, 1f, gp1);
			g.FillPath(b3, gp1);
			g.DrawImage(perlin.NoiseMap, new Rectangle(0, 0, perlin.NoiseMap.Width, perlin.NoiseMap.Height));
		}
Пример #4
0
		protected override void OnPaint(PaintEventArgs e) {
			Graphics g = e.Graphics;
			GraphicsHelper helper = new GraphicsHelper(g);

			g.Clear(Parent.BackColor);
			g.SmoothingMode = SmoothingMode.AntiAlias;

			Rectangle box = new Rectangle(0, 0, 15, 15);

			GraphicsPath gp1 = helper.CreateRoundedPath(box, 3);

			GraphicsPath pathCheck = new GraphicsPath();
			pathCheck.AddLine(0, 4, 1, 4);
			pathCheck.AddLine(1, 4, 4, 7);
			pathCheck.AddLine(4, 7, 11, 0);
			pathCheck.AddLine(11, 0, 12, 1);
			pathCheck.AddLine(12, 1, 4, 9);
			pathCheck.AddLine(4, 9, 0, 5);
			pathCheck.AddLine(0, 5, 0, 4);
			pathCheck.AddLine(0, 4, 4, 8);
			pathCheck.AddLine(4, 8, 11, 1);

			Pen p1 = new Pen(Color.FromArgb(209, 209, 209));
			Pen p2 = new Pen(Color.FromArgb(68, 110, 175));
			Pen p3 = new Pen(Color.FromArgb(88, 160, 215));
			Brush b1 = new SolidBrush(Color.FromArgb(233, 233, 233));

			g.FillPath(b1, gp1);
			g.DrawPath(p1, gp1);

			if (this.Checked) {
				g.DrawPath(p3, pathCheck, 2, 3);
			}

			g.DrawString(this.Text, this.Font, Brushes.Black, new PointF(box.X + box.Width + 3, box.Y + 2));
		}