-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPencil.cs
More file actions
27 lines (23 loc) · 738 Bytes
/
Pencil.cs
File metadata and controls
27 lines (23 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System.Drawing;
namespace ProjectOOP
{
internal class Pencil : Tool
{
public Pencil(Color color, float width) : base(color, width) { }
public override void Draw(Graphics g, Point start, Point end)
{
if (start == end)
{
Brush brush = new SolidBrush(this.color);
g.FillEllipse(brush, start.X - this.width / 2, start.Y - this.width / 2, width, width);
} else
{
g.DrawLine(base.pen, end, start);
}
}
public override void Draw(Graphics g, Point start, Point end, Bitmap bitmap)
{
throw new System.NotImplementedException();
}
}
}