diff --git a/examples/PainterExamples/DrawArc.cpp b/examples/PainterExamples/DrawArc.cpp new file mode 100644 index 000000000..c5603391e --- /dev/null +++ b/examples/PainterExamples/DrawArc.cpp @@ -0,0 +1,27 @@ +#include "Examples.h" + +void DrawArc(Painter& sw) +{ + Pointf center(350, 300); + for(int i = 0; i < 12; i++) { + double angle = (i - 3) * M_PI / 6; + Pointf box_center = Polar(center, 250, angle); + Size radius(60, 20); + Rect box(Point(box_center), Size(1, 1)); + box.Inflate(radius); +// sw.DrawRect(box, Yellow()); + for(int j = 0; j < 12; j++) { + double ang2 = j * M_PI / 6; + Sizef hand = Polar(Pointf(0, 0), 1, ang2); + Point h1(box_center + Sizef(radius) * hand); + Point h2(box_center + Sizef(radius) * 0.7 * hand); + sw.DrawLine(h1, h2, 1, LtBlue()); + } + Sizef hand = Polar(Pointf(0, 0), 1, angle); + sw.DrawArc(box, Point(box_center + radius * hand), box.TopCenter(), 0, LtRed()); + } +} + +INITBLOCK { + RegisterExample("DrawArc", DrawArc); +} diff --git a/examples/PainterExamples/PainterExamples.upp b/examples/PainterExamples/PainterExamples.upp index 59866f362..1089bc847 100644 --- a/examples/PainterExamples/PainterExamples.upp +++ b/examples/PainterExamples/PainterExamples.upp @@ -32,6 +32,7 @@ file ThinLine.cpp, Shapes.cpp, PolyPoly.cpp, + DrawArc.cpp, Big.cpp, Examples.lay, Test.iml;