LBitmapWindow::SetDefaultDithering

Summary

Specifies the default dithering method to use when converting an image from 32, 24, or 16 bits per pixel to 8 bits per pixel or fewer.

Syntax

#include "ltwrappr.h"

virtual L_INT LBitmapWindow::SetDefaultDithering(uMethod)

Parameters

L_UINT uMethod

The dithering mode to be set for the bitmap. This is the local dithering mode for the class object and will not affect the global dithering mode. The dithering mode will be set when painting the bitmap. Possible values are:

Value Meaning
NO_DITHERING [0] Use no dithering.
FLOYD_STEIN_DITHERING [1] Use the Floyd-Steinberg method.
BURKES_DITHERING [3] Use the Burkes method.
STUCKI_DITHERING [2] Use the Stucki method.
SIERRA_DITHERING [4] Use the Sierra method.
STEVENSON_ARCE_DITHERING [5] Use the Stevenson-Arce method.
JARVIS_DITHERING [6] Use the Jarvis method.
ORDERED_DITHERING [7] Use ordered dithering, which is faster than other methods but is lower in quality.
CLUSTERED_DITHERING [8] Use clustered dithering.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

Use this function to set the default dithering mode for the class object. The local setting will be set when painting the bitmap.

Some LEADTOOLS functions automatically dither an image when necessary for display. Those functions use the default dithering method that this function specifies.

For general information about dithering, refer to Color Resolution and Dithering.

This will also set the default dithering for the floater bitmap to the passed value.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

L_INT LBitmapWindow__SetDefaultDitheringExample() 
{ 
   L_INT nRet; 
   LBitmapWindow MyBitmap; 
 
   nRet =MyBitmap.Load(MAKE_IMAGE_PATH(TEXT("image1.cmp")),24); 
   if(nRet !=SUCCESS) 
      return nRet; 
 
   nRet =MyBitmap.SetDefaultDithering(CLUSTERED_DITHERING); 
   if(nRet !=SUCCESS) 
      return nRet; 
 
   return SUCCESS; 
} 
Help Version 22.0.2023.2.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 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.