private Image CreatePegHoleImage() //создание изображения для "дырочек" { Image img; img = new Bitmap(this.boxWidth - 6, this.boxWidth - 6); Graphics g = Graphics.FromImage(img); g.Clear(this.BackColor); g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; g.FillEllipse(new SolidBrush(Color.Gray), new Rectangle(4, 4, boxWidth - 14, boxWidth - 14)); DrawingUtility.DrawInsetCircle(ref g, new Rectangle(4, 4, boxWidth - 14, boxWidth - 14), new Pen(this.BackColor)); return(img); }
private Image CreateResultPegHole() { Image img; int RbWidth = this.ResultBoxes[0, 0].Width; img = new Bitmap(RbWidth, RbWidth); Graphics g = Graphics.FromImage(img); g.Clear(this.BackColor); g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; g.FillEllipse(new SolidBrush(Color.Gray), new Rectangle(3, 3, RbWidth - 6, RbWidth - 6)); DrawingUtility.DrawInsetCircle(ref g, new Rectangle(3, 3, RbWidth - 6, RbWidth - 6), new Pen(this.BackColor)); return(img); }
private Image CreateResultPegHole() //объединение методов для прорисовки "дырочки" { //и вывод конечного изображения Image img; int RbWidth = this.ResultBoxes[0, 0].Width; img = new Bitmap(RbWidth, RbWidth); Graphics g = Graphics.FromImage(img); g.Clear(this.BackColor); g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; g.FillEllipse(new SolidBrush(Color.Gray), new Rectangle(3, 3, RbWidth - 6, RbWidth - 6)); DrawingUtility.DrawInsetCircle(ref g, new Rectangle(3, 3, RbWidth - 6, RbWidth - 6), new Pen(this.BackColor)); return(img); }