-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Circle.h
43 lines (36 loc) · 776 Bytes
/
Circle.h
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "Figure.h"
class Circle : public virtual Figure
{
public:
Circle(int center_X, int center_Y, int radius, COLORREF color = RGB(255, 0, 0))
: Figure(center_X - radius, center_Y - radius, radius * 2, radius * 2)
{
this->color = color;
}
Circle() : Figure(200, 200, 50, 50)
{
color = RGB(255, 0, 0);
}
COLORREF GetShapeColor() const
{
return color;
}
void SetShapeColor(COLORREF color)
{
this->color = color;
}
void SetShapeColor(unsigned char red, unsigned char green, unsigned char blue)
{
color = RGB(red, green, blue);
}
void SetShapeColor(SHAPE_COLOR c)
{
color = SHAPECOLOR_to_COLORREF(c);
}
void Draw()
{
SetPen(0, 0);
SetBrush(color);
Ellipse(hdc, tl.GetX(), tl.GetY(), tl.GetX() + width, tl.GetY() + height);
}
};