LBitmapWindow::SetDisplayMode

#include "ltwrappr.h"

virtual L_INT LBitmapWindow::SetDisplayMode(uFlagPos, uFlagSet)

L_UINT32 uFlagPos;

/* Flag or flags to be changed */

L_UINT32 uFlagSet;

/* Flags (of those in uFlagPos) to be turned on */

Sets flags that control the speed, quality, and style of painting operations.

Parameter

Description

uFlagPos

The flag or flags to be changed. You can use a bitwise OR ( | ) to specify more than one flag. You can use DISPLAYMODE_RESETPOSITIONS to indicate all flags.

 

Refer to Flags for the LBitmapWindow::SetDisplayMode Function for descriptions of the flags.

uFlagSet

The flags (of those specified in the uFlagPos parameter) to be turned on. You can use a bitwise OR ( | ) to include more than one flag. You can use 0 to turn off all the flags specified in the uFlagPos parameter.

 

Refer to Flags for the LBitmapWindow::SetDisplayMode Function for descriptions of the flags.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This will be the local display mode setting for the class object and is used when painting the bitmap.

The first parameter specifies which flags are affected, and the second specifies which of those to turn on. The other affected flags are turned off.

Therefore:

image\sqrblit.gif To turn a flag on, specify it in the first parameter and the second.

image\sqrblit.gif To turn a flag off, specify it in the first parameter, but not the second.

For example, the following statement turns on fast painting, turns off dithered painting, and leaves all other flags as they were:

MyBitmapBase::SetDisplayMode( DISPLAYMODE_FASTPAINT | DISPLAYMODE_DITHEREDPAINT, DISPLAYMODE_FASTPAINT );

This will set the display flags for the floater bitmap to the passed values and will create a new paint palette for the bitmap window and the floater.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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

See Also

Functions:

LBitmapBase::GetDisplayMode, LBitmapWindow::EnableLocalSettings, LBitmapBase::IsLocalSettingsEnabled, Class Members

Topics:

Raster Image Functions: Displaying Images

 

Raster Image Functions: Palettes

 

Handling Palette Changes

Example

L_INT LBitmapWindow__SetDisplayModeExample()
{
   L_INT nRet;
   LBitmapWindow MyBitmap;
   nRet =MyBitmap.Load(TEXT("C:\\Program Files\\LEAD Technologies, Inc\\LEADTOOLS 15.0\\Images\\image1.cmp"),24);
   if(nRet !=SUCCESS)
      return nRet;
   nRet =MyBitmap.SetDisplayMode(DISPLAYMODE_SCALETOGRAY, DISPLAYMODE_SCALETOGRAY);
   if(nRet !=SUCCESS)
      return nRet;
   return SUCCESS;
}