LBitmap::PicturizeCallBack

#include "ltwrappr.h"

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

pBITMAPHANDLE pCellBitmap;

/* pointer to the bitmap handle */

L_INT x;

/* X coordinate */

L_INT y;

/* Y coordinate */

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

Parameter

Description

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.

x

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

y

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

Returns

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

LTDIS
LTFIL
LTIMG

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:

LBitmap::Picturize, Class Members

Example

#include "ltwrappr.h"
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 MyPicturizeFunc(HWND hWnd)
{
   LUserBitmap LeadBitmap(hWnd);

   //Load an image
   LeadBitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);

   // Call add noise function
   // during the calling of this function
   // StatusCallBack will be called
   int nRet = LeadBitmap.Picturize(
            TEXT("d:\\ltwin14\\images"),
            PICTURIZE_LOADALL|PICTURIZE_RESIZE,
            32, 32);
   return nRet;
}