关于画图画线
QPixmap createLinePixmap(QSize size, QString str)
{
QPixmap pixmap(size);
QPainter painter(&pixmap);
painter.setPen(Qt::NoPen);
int nR = str.section(",",0,0).toInt();
int nG = str.section(",",1,1).toInt();
int nB = str.section(",",2,2).toInt();
int nA = 255;
QColor color = QColor(nR,nG,nB,nA);
painter.fillRect(QRect(0, 0, size.width(),size.height()),color);
return pixmap;
}
QPixmap createTextPixmap(QSize size, QString str)
{
QPixmap pixmap(size);
QPainter painter(&pixmap);
painter.setPen(Qt::NoPen);
int nR = str.section(",",0,0).toInt();
int nG = str.section(",",1,1).toInt();
int nB = str.section(",",2,2).toInt();
int nA = 255;
QColor color = QColor(nR,nG,nB,nA);
painter.fillRect(QRect(0, 0, size.width(),size.height()),color);
return pixmap;
}
void sltOpenImage(){
QString strPath = HFDialogPathMemory::getOpenFileName("PaddingImage", this, "Image", QDir::currentPath(), "Image Files(*.png *.jpg *.bmp *.jpeg)");}}