2017-09-16 16:34:45 +09:00
|
|
|
// image.cpp
|
|
|
|
|
2018-08-14 09:07:09 +09:00
|
|
|
// QXlsx
|
|
|
|
// MIT License
|
|
|
|
// https://github.com/j2doll/QXlsx
|
|
|
|
//
|
|
|
|
// QtXlsx
|
|
|
|
// https://github.com/dbzhang800/QtXlsxWriter
|
|
|
|
// http://qtxlsx.debao.me/
|
|
|
|
// MIT License
|
|
|
|
|
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;
|
|
|
|
}
|