libxlsxwriter
background.c
<< outline_collapsed.c tab_colors.c >>

Example of how to set the background image for a worksheet.

/*
* An example of setting a worksheet background image with libxlsxwriter.
*
* Copyright 2014-2021, John McNamara, jmcnamara@cpan.org
*
*/
#include "xlsxwriter.h"
int main() {
lxw_workbook *workbook = workbook_new("background.xlsx");
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
worksheet_set_background(worksheet, "logo.png");
workbook_close(workbook);
return 0;
}
workbook_close
lxw_error workbook_close(lxw_workbook *workbook)
Close the Workbook object and write the XLSX file.
workbook_new
lxw_workbook * workbook_new(const char *filename)
Create a new workbook object.
worksheet_set_background
lxw_error worksheet_set_background(lxw_worksheet *worksheet, const char *filename)
Set the background image for a worksheet.
lxw_worksheet
Struct to represent an Excel worksheet.
Definition: worksheet.h:2107
lxw_workbook
Struct to represent an Excel workbook.
Definition: workbook.h:280
workbook_add_worksheet
lxw_worksheet * workbook_add_worksheet(lxw_workbook *workbook, const char *sheetname)
Add a new worksheet to a workbook.