LBitmapSettings::GetDisplayMode

Summary

Gets the painting control flags, which are set by the LBitmapSettings::SetDisplayMode function.

Syntax

#include "ltwrappr.h"

static L_UINT32 LBitmapSettings::GetDisplayMode()

Returns

The unsigned integer containing the painting control flags.

Comments

Possible values for the display mode are:

Value Meaning
DISPLAYMODE_ORDEREDDITHER [0x00000001] Enables or disables ordered dithering when painting. Ordered dithering is faster than the default dithering method, which uses error diffusion, but the quality of the image is not as good.
DISPLAYMODE_FASTPAINT [0x00000002] Enables or disables fast painting. Fast painting should be performed only if the current video driver is good, and the image does not need to be dithered or resized to paint. No safety check for a faulty driver is performed.
DISPLAYMODE_INDEXEDPAINT [0x00000004] Enables or disables painting that is mapped directly to the selected palette. This is enabled by default; you can set this flag to disable it and let Windows do color matching between the paint palette and the selected palette.
DISPLAYMODE_DITHEREDPAINT [0x00000008] Enables or disables dithered painting. This is enabled by default, but you can set this flag to false to disable it. When enabled, Floyd-Steinberg dithering is used to dither true color or high color images on devices that are 8 bits per pixel or less. When disabled, the device is responsible for color reduction.
DISPLAYMODE_SCALETOGRAY [0x00000010] (Document/Medical only) Enables grayscaling of 1-bit images when they are displayed. This improves the readability of the images when they are zoomed in or zoomed out, but it slows down the display. If you enable grayscaling, you must call LBitmapBase::CreatePaintPalette, then select and realize the palette before painting an image.
DISPLAYMODE_HALFTONEPRINT [0x00000020] Enables use of the printing halftone (rather than the viewing halftone) when painting to a 1-bit device. This is useful if you are using the LPaint::PaintDC function for printing.
DISPLAYMODE_FAVORBLACK [0x00000040] (Document/Medical only) Enables a bias in preserving black objects when displaying zoomed-out 1-bit images. This can prevent the disappearance of fine lines and details, but it slows down the display.
DISPLAYMODE_FIXEDPALETTE [0x00000080] Forces the use of a fixed palette when painting to a device that supports 256 colors or less. When this flag is off, the bitmap handle controls palette usage. When this flag is on, the default is the LEAD fixed palette, but on 256-color devices, the Netscape palette is used if the DISPLAYMODE_NETSCAPEPALETTE flag is also set.
DISPLAYMODE_NETSCAPEPALETTE [0x00000100] Sets the Netscape fixed palette as the preferred fixed palette when painting to a device that supports 256 colors. This fixed palette is employed by both Netscape Navigator and Microsoft Internet Explorer.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

L_INT LBitmapSettings__GetDisplayModeExample(HWND hWnd) 
{ 
    
   if (LBitmapSettings::GetDisplayMode() == DISPLAYMODE_SCALETOGRAY) 
   { 
      MessageBox (NULL, TEXT("Already using scale-to-gray"), TEXT("Notice"), MB_OK); 
   } 
   else if (LBitmapSettings::IsSupportLocked(L_SUPPORT_DOCUMENT)) 
   { 
      MessageBox (NULL, TEXT("No scale to gray - You need to unlock Document/Medical capabilities"), TEXT("Notice"), MB_OK); 
   } 
   else 
   { 
      /* Set the display mode to scale-to-gray */ 
      LBitmapSettings::SetDisplayMode(DISPLAYMODE_SCALETOGRAY, DISPLAYMODE_SCALETOGRAY); 
 
      /* Get a new palette as the paint palette because we are now using grayscale, instead of 1-bit */ 
      SendMessage (hWnd, WM_QUERYNEWPALETTE, 0, 0L); 
   } 
 
   return SUCCESS; 
} 
Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.