LBitmapBase::ColorResBitmapCallBack

#include "ltwrappr.h"

virtual L_INT LBitmapBase::ColorResBitmapCallBack(pBitmap, pBuffer, nLines)

Handles the converted image data that the LBitmapBase::ColorRes function has written to a buffer.

Parameters

pBITMAPHANDLE pBitmap

The pointer to the bitmap handle referencing the bitmap that contains the image information.

L_UCHAR * pBuffer

A pointer to a buffer containing one or more lines of output image data that the calling function has already converted.

L_INT nLines

The number of lines in the pBuffer buffer.

Returns

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

Comments

This function is called for the color resolution operation only if the callback functions are enabled. You can override this function to do your own processing. If you return an error code then the operation will be terminated. This function will be called only if you enabled the callback functions using LBase::EnableCallBack(TRUE).

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Example

class ColorResBitmap : public LBitmapBase  
 
{ 
 
protected: 
 
virtual L_INT ColorResBitmapCallBack (pBITMAPHANDLE pBitmap, L_UCHAR  * pBuffer, L_INT nLines); 
 
 
}; 
 
 
 
L_INT ColorResBitmap::ColorResBitmapCallBack(pBITMAPHANDLE pBitmap, L_UCHAR  * pBuffer, L_INT nLines) 
 
{ 
   UNREFERENCED_PARAMETER(nLines); 
   UNREFERENCED_PARAMETER(pBuffer); 
   UNREFERENCED_PARAMETER(pBitmap); 
 
 
       ::MessageBox(0,TEXT("Color Res"),TEXT("Color Res"),MB_OK); 
 
       return(SUCCESS); 
 
} 
 
 
 
L_INT LBitmapBase__ColorResBitmapCallBackExample() 
{ 
   L_INT nRet; 
   ColorResBitmap Bitmap ; 
 
   nRet =Bitmap.Load(MAKE_IMAGE_PATH(TEXT("image1.cmp")),24); 
   if(nRet !=SUCCESS) 
      return nRet; 
   if(Bitmap.IsCallBackEnabled()==FALSE) 
      Bitmap.EnableCallBack(TRUE); 
 
   //this will call ColorResCallBack() 
   nRet =Bitmap.ColorRes(8,CRF_FIXEDPALETTE|CRF_FLOYDSTEINDITHERING); 
   if(nRet !=SUCCESS) 
      return nRet; 
 
   return SUCCESS; 
} 
Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.