Attaches a bitmap to the class object.
#include "Ltwrappr.h"
L_INT LRasterPaintWindow::SetBitmap(pLBitmap)
Pointer to an LBitmapBase class object which contains the bitmap to attach to the LRasterPaintWindow class object.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
LRasterPaintWindow::Initialize must be called before calling this function.
The bitmap set by calling this function is the bitmap that will be displayed in the RasterPaint window. This is also the bitmap on which painting will occur.
L_INT LRasterPaintWindow_SetBitmapExample(LRasterPaintWindow *pRasterPntWnd ,HWND hWnd)
{
L_INT nRet;
LBitmapBase *LBtmpbase = new LBitmapBase();
pRasterPntWnd = new LRasterPaintWindow();
nRet = LBtmpbase->Initialize();
if(nRet != SUCCESS)
return nRet;
LDialogFile DlgFile;
nRet = LDialogFile::Initialize (0);
if(nRet != SUCCESS)
return nRet;
DlgFile.SetBitmap (LBtmpbase);
OPENDLGPARAMS DlgParams ;
memset ( &DlgParams, 0, sizeof ( OPENDLGPARAMS ) ) ;
DlgParams.uStructSize = sizeof ( OPENDLGPARAMS ) ;
nRet = DlgFile.SetOpenParams (&DlgParams) ;
if(nRet != SUCCESS)
return nRet;
nRet = DlgFile.DoModalOpen(hWnd);
if(nRet < 1)
return nRet;
L_TCHAR szFile[260];
DlgFile.GetFileName (szFile, sizeof(szFile));
nRet = LBtmpbase->Load(szFile);
LRasterPaintWindow::Initialize();
nRet = pRasterPntWnd->SetWndHandle(hWnd);
if(nRet != SUCCESS)
return nRet;
nRet = pRasterPntWnd->SetBitmap(LBtmpbase);
if(nRet != SUCCESS)
return nRet;
return SUCCESS;
}