UID:134830
#include "frame.h" #include "ui_frame.h" #include <QPainter> #include <QPixmap> QPixmap *px; Frame::Frame(QWidget *parent) : QFrame(parent), ui(new Ui::Frame) { ui->setupUi(this); draw(); } Frame::~Frame() { delete ui; } void Frame::draw() { QPixmap pm(this->width(),this->height()); QPainter p(&pm); p.drawLine(0,0,100,100); px=new QPixmap(pm); this->update(); } void Frame::paintEvent(QPaintEvent *e) { QPainter p1(this); p1.drawPixmap(0,0,this->width(),this->height(),*px); //p1.drawImage(0,0,px->toImage()); }
UID:7394
引用楼主tonylin于2012-08-03 15:51发表的 請問各位大大 有關pixmap的問題 :當我執行之後在放大解析度就變很差 請問有沒有什麼辦法可以解決.......
UID:2