// Widget.cpp

#include "Widget.h"
#include "ui_Widget.h"
#include <QPixmap>
#include <QPainter>


Widget::Widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::Widget)
{
ui->setupUi(this);

/*
QPixmap pix(300, 300);
pix.fill(Qt::white); // 填充颜色

// 声明画家
QPainter painter(&pix);
painter.setPen(QPen(Qt::green));
painter.drawEllipse(QPoint(150, 150), 100, 100);

// 保存
pix.save("C:/Users/win10/Desktop/test.png");
*/


/*
QImage image(300, 300, QImage::Format_RGB32);
image.fill(Qt::white);

QPainter painter(&image);
painter.setPen(Qt::blue);
painter.drawEllipse(QPoint(150, 150), 100, 100);

image.save("C:/Users/win10/Desktop/test.png");
*/
}


Widget::~Widget()
{
delete ui;
}