QT的其他绘图

	#include <QPainter>
	QPainter painter(this);

    painter.drawEllipse(QPoint(200,200),50,50);
    painter.setRenderHint(QPainter::Antialiasing);          //抗锯齿
    painter.drawEllipse(QPoint(400,200),50,50);

    painter.drawRect(QRect(20,20,50,50));
    painter.translate(100,0);           //移动原点
    painter.save();                         //将移动的位置置为原点
    painter.drawRect(QRect(20,20,50,50));
    painter.translate(100,0);
    painter.restore();                      //恢复save原点位置
    painter.drawRect(QRect(20,20,50,50));

    QPixmap pixmap;
    pixmap.load(":/prefix1/image/7.png");
    painter.drawPixmap(x,y,pixmap);
已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 1024 设计师:白松林 返回首页