1
0
mirror of https://github.com/QtExcel/QXlsx.git synced 2025-01-30 05:02:52 +08:00
QXlsx/TestExcel/image.cpp

20 lines
369 B
C++
Raw Normal View History

2017-09-16 16:34:45 +09:00
// image.cpp
2017-09-16 12:21:23 +09:00
#include <QtGui>
#include "xlsxdocument.h"
2017-09-16 16:34:45 +09:00
int image()
2017-09-16 12:21:23 +09:00
{
QXlsx::Document xlsx;
QImage image(40, 30, QImage::Format_RGB32);
image.fill(Qt::green);
for (int i=0; i<10; ++i)
xlsx.insertImage(10*i, 5, image);
2017-09-23 11:12:59 +09:00
xlsx.saveAs("image1.xlsx");
2017-09-16 12:21:23 +09:00
2017-09-23 11:12:59 +09:00
QXlsx::Document xlsx2("image1.xlsx");
xlsx2.saveAs("image2.xlsx");
2017-09-16 12:21:23 +09:00
return 0;
}