LEDs are drawn

This commit is contained in:
Ollo
2023-08-15 12:51:35 +02:00
parent 980ef0812f
commit c15368b35e
2 changed files with 18 additions and 6 deletions

View File

@@ -13,9 +13,21 @@ MainWindow::MainWindow(QWidget *parent)
ui->setupUi(this);
this->server = new UdpLedServer ();
this->mOffscreenDiagram = new QImage(DEFAULT_WIDTH, DEFAULT_HEIGHT, QImage::Format_RGB32);
this->mOffscreenDiagram->fill(COLOR_BACKGROUND);
this->mOffscreenPanel = new QImage(DEFAULT_WIDTH, DEFAULT_HEIGHT, QImage::Format_RGB32);
this->mOffscreenPanel->fill(COLOR_BACKGROUND);
/* draw inital screen */
QPainter painter(this->mOffscreenPanel);
painter.setRenderHint(QPainter::Antialiasing, true);
painter.setPen(QPen(COLOR_FOREGROUND, 1));
painter.setBrush(COLOR_FOREGROUND);
for(int x=0; x < (PANEL_WIDTH * MAXIMUM_PANELSIZE); x++) {
for(int y=0; y < PANEL_HEIGHT; y++) {
painter.drawEllipse(LED_DIAMETER/2 + (x* LED_DISTANCE), LED_DIAMETER/2 + (y * LED_DISTANCE), LED_DIAMETER, LED_DIAMETER);
}
}
this->drawImage(this->mOffscreenPanel);
}
MainWindow::~MainWindow()