Build 5.0.0.29 of xlsgen comes with support for in-cell picture metadata.
The first feature is exposed in the object model, at the
cell level, a mechanism to add a picture whose boundaries are within the cell in question. More specifically the picture is resized to fit into that cell, and the X/Y ratio is preserved.
This is how you do it (here with C++) :
worksheet->Cell[3][4]->InPlacePicture = L"input\\picture.jpg"; // picture in cell D3
If that was all there was about it, that would be pretty small a thing. But there is more to it. What xlsgen does is create metadata in that cell, specifically picture metadata, which actually extends the capabilities of the cell. It can contain a number, a date, a string, a formula and now a picture. If then a formula is created elsewhere, making a reference to that cell, the picture is carried over. Making it possible to run new scenarios that were not possible before.
So if in F3 you write,
worksheet->Formula[3][6] = L"=D3";
then F3 has a picture in it !
Of course, many more complex formulas can be used in order to achieve actually useful scenarios.
If you print/preview/PDF/XPS export the worksheet, it will render the pictures created as such or referred to as such in formulas.
The metadata is written back to the file as long as the file is XLSX, XLSM or XLSB. If you open the resulting file and you are using Office 365, you will see the pictures if you are using an updated Office version. If you are using Excel 2021 or an older version however, no picture will be shown in Excel and you'll get an "#UNKNOWN!" error string in those cells instead. The Excel file isn't corrupted, it just can't support a feature that was written later on.