diff --git a/main.cpp b/main.cpp index bba62e0..595937c 100644 --- a/main.cpp +++ b/main.cpp @@ -25,14 +25,18 @@ void QTSGraph::PaintBox() Line(0, 0, 600, 600); SetColor(0xFF0000); Line(600, 0, 0, 600); - Rectangle(0,0,600,600); + Rectangle(0, 0, 600, 600); SetColor(clBlue); SetTextStyle(0, 45, 10); OutTextXY(30, 30, "Hello world!"); SetTextStyle(1, 0, 20); OutTextXY(210, 50, "Hello world!"); - SetTextStyle(2, 0, 30); - OutTextXY(160, 550, "Hello world!"); + SetTextStyle(2, 180, 30); + OutTextXY(460, 550, "Hello world!"); + SetColor(0x999999); + SetPenStyle(5); + SetFillStyle(1, clMagenta); + Ellipse(250, 280, 350, 320); // Конец рисования } diff --git a/qtsgraph.cpp b/qtsgraph.cpp index 2bdd0d2..3188aad 100644 --- a/qtsgraph.cpp +++ b/qtsgraph.cpp @@ -45,6 +45,15 @@ void QTSGraph::Delay(int ms) QCoreApplication::processEvents(QEventLoop::AllEvents, 50); } +void QTSGraph::Ellipse(int x1, int y1, int x2, int y2) +{ + QPainter painter(&Canvas); + painter.setPen(Pen); + painter.setBrush(Brush); + painter.drawEllipse(x1, y1, abs(x2-x1), abs(y2-y1)); + update(); +} + QRgb QTSGraph::GetPixel(int x, int y) { return Canvas.toImage().pixelColor(x, y).rgba(); diff --git a/qtsgraph.h b/qtsgraph.h index 4bc7c9f..25572a7 100644 --- a/qtsgraph.h +++ b/qtsgraph.h @@ -71,6 +71,7 @@ public: void Circle(int x, int y, int radius); void Delay(int ms = 1000); + void Ellipse(int x1, int y1, int x2, int y2); QRgb GetPixel(int x, int y); void Line(int x1, int y1, int x2, int y2); bool KeyPressed();