mirror of
https://github.com/QtExcel/QXlsx.git
synced 2025-01-30 05:02:52 +08:00
29 lines
530 B
C++
29 lines
530 B
C++
// image.cpp
|
|
|
|
// QXlsx
|
|
// MIT License
|
|
// https://github.com/j2doll/QXlsx
|
|
//
|
|
// QtXlsx
|
|
// https://github.com/dbzhang800/QtXlsxWriter
|
|
// http://qtxlsx.debao.me/
|
|
// MIT License
|
|
|
|
#include <QtGui>
|
|
#include "xlsxdocument.h"
|
|
|
|
int image()
|
|
{
|
|
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);
|
|
xlsx.saveAs("image1.xlsx");
|
|
|
|
QXlsx::Document xlsx2("image1.xlsx");
|
|
xlsx2.saveAs("image2.xlsx");
|
|
|
|
return 0;
|
|
}
|