finish birthday namecreater
This commit is contained in:
parent
615fa0e283
commit
6025cc2913
@ -11,3 +11,18 @@ name_1,bg_type
|
|||||||
甃<EFBFBD>和,g
|
甃<EFBFBD>和,g
|
||||||
︺<EFBFBD>诧,y
|
︺<EFBFBD>诧,y
|
||||||
甃<EFBFBD>和,b
|
甃<EFBFBD>和,b
|
||||||
|
︺<EFBFBD>诧,b
|
||||||
|
甃<EFBFBD>和,b
|
||||||
|
<EFBFBD>衱郝,b
|
||||||
|
え<EFBFBD>丹,y
|
||||||
|
︺<EFBFBD>诧,b
|
||||||
|
甃<EFBFBD>和,g
|
||||||
|
<EFBFBD>衱郝,g
|
||||||
|
え<EFBFBD>丹,r
|
||||||
|
︺<EFBFBD>诧,r
|
||||||
|
甃<EFBFBD>和,r
|
||||||
|
︺<EFBFBD>诧,y
|
||||||
|
甃<EFBFBD>和,y
|
||||||
|
甃<EFBFBD>和,r
|
||||||
|
︺<EFBFBD>诧,g
|
||||||
|
甃<EFBFBD>和,b
|
||||||
|
|||||||
|
@ -178,7 +178,7 @@ int main(int argc, char* argv[])
|
|||||||
msgBox.exec();
|
msgBox.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
QGraphicsScene scene(0, 0, 3508, 2482);
|
QGraphicsScene scene;
|
||||||
scene.setBackgroundBrush(QBrush(QColor(255, 255, 255)));
|
scene.setBackgroundBrush(QBrush(QColor(255, 255, 255)));
|
||||||
QGraphicsView view(&scene);
|
QGraphicsView view(&scene);
|
||||||
|
|
||||||
@ -190,13 +190,20 @@ int main(int argc, char* argv[])
|
|||||||
|
|
||||||
|
|
||||||
for (int n = 0; n < nameList.length(); n++) {
|
for (int n = 0; n < nameList.length(); n++) {
|
||||||
if (n >= BG_POS_COUNT)break;
|
int idx = n % BG_POS_COUNT;
|
||||||
NameInfo_t name_info = nameList.at(n);
|
NameInfo_t name_info = nameList.at(n);
|
||||||
QImage name_image(name_info.bg_path);
|
QImage name_image(name_info.bg_path);
|
||||||
|
if (idx == 0) {
|
||||||
|
QGraphicsRectItem* bg_item = new QGraphicsRectItem(0, 0, 3508, 2482);
|
||||||
|
bg_item->setBrush(QBrush(QColor(255, 255, 255)));
|
||||||
|
scene.addItem(bg_item);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QGraphicsPixmapItem* name_bgItem = new QGraphicsPixmapItem(QPixmap::fromImage(name_image));
|
QGraphicsPixmapItem* name_bgItem = new QGraphicsPixmapItem(QPixmap::fromImage(name_image));
|
||||||
bool rot = (n == 10 || n == 11);
|
bool rot = (idx == 10 || idx == 11);
|
||||||
name_bgItem->setRotation(rot ? -90 : 0);
|
name_bgItem->setRotation(rot ? -90 : 0);
|
||||||
name_bgItem->setPos(BG_POS[n]);
|
name_bgItem->setPos(BG_POS[idx]);
|
||||||
scene.addItem(name_bgItem);
|
scene.addItem(name_bgItem);
|
||||||
|
|
||||||
|
|
||||||
@ -207,7 +214,7 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
QString name = name_info.name1;
|
QString name = name_info.name1;
|
||||||
for (int j = 0; j < 2; j++) {
|
for (int j = 0; j < 2; j++) {
|
||||||
int pos_idx = n * 2 + j;
|
int pos_idx = idx * 2 + j;
|
||||||
int xscale, yscale;
|
int xscale, yscale;
|
||||||
|
|
||||||
xscale = yscale = (j == 1) ? -1 : 1;
|
xscale = yscale = (j == 1) ? -1 : 1;
|
||||||
@ -264,20 +271,23 @@ int main(int argc, char* argv[])
|
|||||||
scene.addItem(textItem3);
|
scene.addItem(textItem3);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
bool is_export_page = ((idx + 1) % BG_POS_COUNT == 0);
|
||||||
|
if (is_export_page || n == nameList.count()-1) {
|
||||||
|
QString file_name = QString("%1_.jpg").arg(QString::number(export_times + 1));
|
||||||
|
saveToImage(file_name, &scene);
|
||||||
|
export_times++;
|
||||||
|
scene.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
QString file_name = QString("%1_.jpg").arg(QString::number(export_times + 1));
|
|
||||||
saveToImage(file_name, &scene);
|
|
||||||
export_times++;
|
|
||||||
|
|
||||||
/*QMessageBox msgBox;
|
QMessageBox msgBox;
|
||||||
msgBox.setText(QString().asprintf("Export Finshed. Count:%d", export_times));
|
msgBox.setText(QString().asprintf("Export Finshed. Count:%d", export_times));
|
||||||
msgBox.exec();*/
|
msgBox.exec();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
font_res.close();
|
font_res.close();
|
||||||
return a.exec();
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user