PictureBox нарисовать смайл
Категория: .NET
2013-07-04 17:07:13
code: #csharp
public void show() { cPen.Color = Color.Black; cBrush.Color = Color.White; Graphics cGraphics = Graphics.FromImage(cPictureBox.Image); cGraphics.FillEllipse(cBrush, X - Size, Y - Size, X + Size, Y + Size); cGraphics.DrawEllipse(cPen, X - Size, Y - Size, X + Size, Y + Size); cPen.Color = Color.Blue; cBrush.Color = Color.Blue; cGraphics.FillEllipse(cBrush, X - 3 * Size / 7, Y - 3 * Size / 7, Size / 2,Size / 2); cGraphics.DrawEllipse(cPen, X - 3 * Size / 7, Y - 3 * Size / 7, Size / 2,Size / 2); cGraphics.FillEllipse(cBrush, X + 5*Size / 6, Y - 3*Size / 6, Size/2,Size/2); cGraphics.DrawEllipse(cPen, X + 5*Size / 6, Y - 3*Size / 6, Size/2,Size/2); cBrush.Color = Color.Red; cBrush.Color = Color.Red; cGraphics.FillRectangle(cBrush, X + 3 * Size / 5, Y + Size / 3, 3 * Size / 5, 2 * Size / 4); cGraphics.DrawRectangle(cPen, X + 3 * Size / 5, Y + Size / 3, 3 * Size / 5, 2 * Size / 4); cPictureBox.Refresh(); cGraphics.Dispose(); }
автор: Nickolai47
Поделиться: