Brandon

Brandon

  • NA
  • 3
  • 0

Custom Colors- Visual C#

Apr 11 2007 3:27 AM
I am trying to, in a nutshell, make a button that when pressed, brings up a colordialog from which a user selects a color, then a pictureBox draws a circle of that color. I can get it to work on startup using; private void pictureBox1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { drawroutine(e.Graphics, Brushes.Red); } private void drawroutine(Graphics g, Brush b) { g.Clear(Color.White); g.FillEllipse(b, 0, 0, 130, 130); } and I imagine I could make this customizable on startup, but its not feasable. The code I have for the button so far is; private void button60_Click(object sender, EventArgs e) { ColorDialog cd = new ColorDialog(); cd.ShowDialog(); HatchBrush hb = new HatchBrush(HatchStyle.Percent50, cd.Color, cd.Color); } and from there I am totally lost. Ive done some googling and searching in this forum but havnt turned anything up. Any help is apreciated.

Answers (1)