static L_INT LFileSettings::SetPLTOptions(pOptions)
Sets the file options used by LEADTOOLS when loading HPGL files.
Pointer to a structure that contains the options to use when loading HPGL files.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
The nSize member of the FILEPLTOPTIONS structure must be set before calling this function. If an HPGL file is loaded without first calling this function, the following default values will be used:
FILEPLTOPTIONS Member | Default value |
---|---|
PenWidth[0] | 1 |
PenWidth[1] | 1 |
PenWidth[2] | 1 |
PenWidth[3] | 1 |
PenWidth[4] | 1 |
PenWidth[5] | 1 |
PenWidth[6] | 1 |
PenWidth[7] | 1 |
PenColor[0] | 0x00FFFFFF |
PenColor[1] | 0x00000000 |
PenColor[2] | 0x000000FF |
PenColor[3] | 0x0000FF00 |
PenColor[4] | 0x0000FFFF |
PenColor[5] | 0x00FF0000 |
PenColor[6] | 0x00FF00FF |
PenColor[7] | 0x00FFFF00 |
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.
For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.
Win32, x64.
This example loads a PLT file, with a pen widths and pen colors defined by the user.
L_INT LFileSettings__SetPLTOptionsExample(L_TCHAR *pszPLTFileName, LBitmap* plBitmap, L_INT *pPenWidths, COLORREF *pPenColors)
{
L_INT nRet;
FILEPLTOPTIONS PltOptions;
L_INT nPen;
/* Get the current PLT options */
nRet = LFileSettings::GetPLTOptions(&PltOptions, sizeof(PltOptions));
if(nRet != SUCCESS)
return nRet;
for ( nPen = 0; nPen < 8; nPen++ )
{
/*Change pen width */
PltOptions.PenWidth[nPen] = pPenWidths[nPen];
/* Change pen color*/
PltOptions.PenColor[nPen] = pPenColors[nPen];
}
/* Set new PLT options */
nRet = LFileSettings::SetPLTOptions(&PltOptions);
if(nRet != SUCCESS)
return nRet;
/* Now load the PLT file */
nRet = plBitmap->Load(pszPLTFileName,
0,
ORDER_RGB,
NULL,
NULL );
if(nRet != SUCCESS)
return nRet;
return SUCCESS;
}
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