Home Documentation Writing Reading Pictures1 Pictures2 Formulas DateTime SheetByName
Merging Grouping InsertRowCol NumFormats Formats Fonts Buffer1 Buffer2 Copying TopNFilter
Sorting StringFilter NumberFilter FilterByValues Protection Replacing RichString BeginWith
ColorScale OpRule AltRows
Merging Grouping InsertRowCol NumFormats Formats Fonts Buffer1 Buffer2 Copying TopNFilter
Sorting StringFilter NumberFilter FilterByValues Protection Replacing RichString BeginWith
ColorScale OpRule AltRows
Placing pictures
This example shows how to insert a picture into an Excel sheet. Note that picture is shared for all sheets in workbook. LibXL supports PNG, JPG and WMF picture formats.#include <iostream> #include "libxl.h" using namespace libxl; int main() { Book* book = xlCreateBook(); if(book) { int id = book->addPicture(L"picture.jpg"); if(id == -1) { std::cout << "picture not found" << std::endl; return -1; } Sheet* sheet = book->addSheet(L"Sheet1"); if(sheet) { sheet->setPicture(10, 1, id); } book->save(L"out.xls"); book->release(); } return 0; }