#include "l_bitmap.h"
L_LTFIL_API L_INT L_SetAutoCADFilesColorScheme(dwFlags)
Sets the current color scheme that LEADTOOLS uses when loading AutoCAD (DXF and DWG) files.
Value that represents the AutoCAD color scheme to set. Possible values are:
Value | Meaning |
---|---|
AUTOCADFILES_COLORSCHEME_BLACKONWHITE | [0] Use Black as the default and White as the background color. |
AUTOCADFILES_COLORSCHEME_WHITEONBLACK | [1] Use White as the default and Black as the background color. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
Note: More options are available in the LOADFILEOPTION structure.
AutoCAD (DXF and DWG) files can be loaded with either black or white background. This function lets you decide on what color scheme to use. Black on White or White on Black.
Note that this function only effects colors number 0 and 7 in the standard AutoCAD color profile. Other colors will not be effected.
This function may be used with the following vector file formats: DXF and DWG. For more information on these file formats and their availability, refer to Files To Be Included With Your Application.
Required DLLs and Libraries
Win32, x64.
This example will set current AutoCAD color scheme to black on white then loads a DXF file
L_INT SetAutoCADFilesColorSchemeExample(L_TCHAR * pszDXFFileName,
pBITMAPHANDLE LeadBitmap)
{
L_INT nRet;
L_UINT32 dwFlags;
/* If the current AutoCAD color scheme is not black on white, change it */
nRet = L_GetAutoCADFilesColorScheme(&dwFlags);
if(nRet != SUCCESS)
return nRet;
if(dwFlags != AUTOCADFILES_COLORSCHEME_BLACKONWHITE)
{
nRet = L_SetAutoCADFilesColorScheme(AUTOCADFILES_COLORSCHEME_BLACKONWHITE);
if(nRet != SUCCESS)
return nRet;
}
/* Load the DXF file */
if(LeadBitmap->Flags.Allocated)
L_FreeBitmap(LeadBitmap);
nRet = L_LoadBitmap(pszDXFFileName, LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, 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