LBitmap::PicturizeCallBack

Summary

Called every time the best match is found to replace the rectangle.

Syntax

#include "ltwrappr.h"

virtual L_INT LBitmap::PicturizeCallBack(pCellBitmap, x, y)

Parameters

pBITMAPHANDLE pCellBitmap

The pointer to the bitmap handle referencing the bitmap that will be placed in the position starting at (x, y). Do not delete or change this bitmap in any way.

L_INT x

X coordinate (column) where the new bitmap has been placed.

L_INT y

Y coordinate (row) where the new bitmap has been placed.

Returns

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

Comments

This callback is called every time the best match is found to replace the rectangle starting at (x, y) in the class object's original bitmap.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Example

class LUserBitmap : public LBitmap   
{ 
   HWND m_hWnd; 
public: 
   LUserBitmap(HWND hwnd); 
   virtual L_INT PicturizeCallBack( 
                                 pBITMAPHANDLE pCellBitmap, 
                                 L_INT x,L_INT y 
                               ); 
virtual ~LUserBitmap(); 
 
}; 
 
////////////////////////////////////////////////////////////////////// 
// Construction/Destruction 
//////////////////////////////////////////////////////////////////// 
LUserBitmap::LUserBitmap(HWND hwnd) 
{ 
   m_hWnd = hwnd; 
} 
 
LUserBitmap::~LUserBitmap() 
{ 
} 
 
L_INT LUserBitmap::PicturizeCallBack( 
                                     pBITMAPHANDLE pThumb, 
                                     L_INT x,L_INT y 
                                     ) 
{ 
   LBitmap ThumbBitmap(pThumb); 
   RECT  rcDest; 
   HDC   hdc = GetDC(m_hWnd); 
 
   // assume that the original bitmap was viewed at 100% zoom factor. 
   // Also assume that we are painting on a 24BPP display.  
   SetRect(&rcDest, x, y, x + ThumbBitmap.GetWidth(), y + ThumbBitmap.GetHeight()); 
 
   // paint the bitmap at (x,y) coordinates 
   ThumbBitmap.Paint()->SetDC(hdc); 
   ThumbBitmap.SetDstRect(&rcDest); 
   ThumbBitmap.Paint()->PaintDC(); 
 
   ReleaseDC(m_hWnd, hdc); 
 
   // return an error code if you want to abort the process 
   return SUCCESS; 
 
} 
 
L_INT LBitmap__PicturizeCallBackExample(HWND hWnd) 
{ 
   L_INT nRet; 
   LUserBitmap LeadBitmap(hWnd); 
 
   //Load an image 
   nRet =LeadBitmap.Load(MAKE_IMAGE_PATH(TEXT("image1.cmp")), 0,ORDER_BGR); 
   if(nRet !=SUCCESS) 
      return nRet; 
 
   // Call add noise function 
   // during the calling of this function 
   // StatusCallBack will be called 
   nRet =LeadBitmap.Picturize(MAKE_IMAGE_PATH(TEXT("")), 
                              PICTURIZE_LOADALL|PICTURIZE_RESIZE, 
                              32, 32); 
   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.