Sets the file options used by LEADTOOLS when loading CSV files.
#include "l_bitmap.h"
L_LTFIL_API L_INT L_SetCSVOptions(pCsvOptions)
Pointer to a structure that contains the options used when loading CSV files.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
The values set by this function are valid for the current thread. To change the values used by the current thread, this function must be called again.
To get the current options used when loading a CSV file, call L_GetCSVOptions.
Win32, x64, Linux.
static L_INT CsvOptionsExample()
{
L_TCHAR* csvFileName = MAKE_IMAGE_PATH("sample.csv");
L_TCHAR* pngFileName = MAKE_IMAGE_PATH("sample-csv.png");
// Change some CSV options
// First get the current options
FILECSVOPTIONS csvOptions;
L_INT nRet = L_GetCSVOptions(&csvOptions, sizeof(csvOptions));
if (nRet != SUCCESS)
return nRet;
// Modify some properties
csvOptions.bHeaderFontItalic = true;
wcscpy_s(csvOptions.szBodyFontName, TEXT("Arial"));
csvOptions.crTableBorderColor = RGB(0xFF, 0x00, 0x00); // Red
// Set them
nRet = L_SetCSVOptions(&csvOptions);
if (nRet != SUCCESS)
return nRet;
// Load the first page from a CSV file
BITMAPHANDLE bitmapHandle;
nRet = L_LoadBitmap(csvFileName, &bitmapHandle, sizeof(bitmapHandle), 0, ORDER_BGRORGRAY, NULL, NULL);
// Save as PNG
if (nRet == SUCCESS)
nRet = L_SaveBitmap(pngFileName, &bitmapHandle, FILE_PNG, 0, 0, NULL);
if (bitmapHandle.Flags.Allocated)
L_FreeBitmap(&bitmapHandle);
return nRet;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document