L_SetAutoCADFilesColorScheme

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_SetAutoCADFilesColorScheme(dwFlags)

L_UINT32 dwFlags;

/* AutoCAD color scheme flags */

Sets the current color scheme that LEADTOOLS uses when loading AutoCAD (DXF and DWG) files.

Parameter

Description

dwFlags

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.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

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 Summary of All Supported Image File Formats.

Required DLLs and Libraries

LTFIL
File format DLLs

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_GetAutoCADFilesColorScheme, L_2DSetViewMode, L_2DGetViewMode, L_2DGetViewport, L_2DSetViewport

Topics:

Raster Image Functions: Loading Files

 

Vector Images

Example

/* This example will set current AutoCAD color scheme to black on white then loads a DXF file */

BITMAPHANDLE LeadBitmap;   /* Bitmap handle to hold the loaded image */

void TestLoad(L_TCHAR L_FAR *pszDXFFileName)
{
   L_UINT32 dwFlags;

   /* If the current AutoCAD color scheme is not black on white, change it */
   L_GetAutoCADFilesColorScheme(&dwFlags);
   if(dwFlags != AUTOCADFILES_COLORSCHEME_BLACKONWHITE)
      L_SetAutoCADFilesColorScheme(AUTOCADFILES_COLORSCHEME_BLACKONWHITE);

   /* Load the DXF file */
   L_LoadBitmap(pszDXFFileName, &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
}