Drawcircle added (emulator)

This commit is contained in:
id101010
2015-04-27 18:36:58 +02:00
parent 6c97e6fc24
commit aed90ef956
8 changed files with 27 additions and 8 deletions

View File

@@ -26,11 +26,7 @@ QRgb QRgbFromRGB565(uint16_t color) {
}
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
image(DISPLAY_WIDTH,DISPLAY_HEIGHT,QImage::Format_RGB16),
ui(new Ui::MainWindow)
{
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), image(DISPLAY_WIDTH,DISPLAY_HEIGHT, QImage::Format_RGB16), ui(new Ui::MainWindow){
ui->setupUi(this);
image.fill(Qt::black);
}
@@ -99,6 +95,16 @@ void MainWindow::draw_bitmap_unscaled(uint16_t x, uint16_t y, uint16_t width, ui
update();
}
void MainWindow::draw_circle(uint16_t x, uint16_t y, uint16_t r, uint16_t color)
{
//render_mutex.lock();
QPainter painter(&(image));
painter.setPen(QColorFromRGB565(color));
painter.drawEllipse(QPoint(x,y), r, r);
//render_mutex.unlock();
update();
}
void MainWindow::paintEvent(QPaintEvent *)
{
//render_mutex.lock();