libxlsxwriter
Loading...
Searching...
No Matches
background.c
<< watermark.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-2024, 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;
}
Struct to represent an Excel workbook.
Definition: workbook.h:293
Struct to represent an Excel worksheet.
Definition: worksheet.h:2115
lxw_workbook * workbook_new(const char *filename)
Create a new workbook object.
lxw_error workbook_close(lxw_workbook *workbook)
Close the Workbook object and write the XLSX file.
lxw_worksheet * workbook_add_worksheet(lxw_workbook *workbook, const char *sheetname)
Add a new worksheet to a workbook.
lxw_error worksheet_set_background(lxw_worksheet *worksheet, const char *filename)
Set the background image for a worksheet.