91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

QT繪圖是學習QT必不可少的技能,以下是畫圖的簡單實現,僅供需要的人士參考。

資源截圖

代碼片段和文件信息

#include?“Form.h“



Form::Form(QWidget?*parent):QWidget(parent)
{???oldx=0;oldy=0;//用來記錄前一坐標(xy)
????this->setAttribute(Qt::WA_NoBackground);
????bDrawing=false;
????curShape=Ellipse;

????this->resize(800600);//初始化兩個緩沖區
????bufferImage=QImage(this->width()this->height()
???????????????????????QImage::Format_ARGB32_Premultiplied);//bufferImage用來存儲最終的圖形
????bufferImage.fill(qRgb(255255255));
????tempImage=QImage(this->width()this->height()
?????????????????????QImage::Format_ARGB32_Premultiplied);//tempImage是臨時緩沖區
}

void?Form::setImage(QString?fileName)//打開文件
{
????this->clear();
????bufferImage.load(fileName);
????this->update();
}

void?Form::saveImage(QString?fileName)//保存文件
{
????QImage?saveFile(fileName“bmp“);
????saveFile=QImage(this->width()thi

評論

共有 條評論