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;
}