SetDIB
Set the Device Independent Bitmap that represents the current data. The MatrixObject will make a copy of the DIB passed in. If a DIB with the specified name already exists then the existing DIB will be replaced (deleted).
BOOL SetDIB( HDIB hDIB, LPCSTR lpcszName = NULL, BOOL bCheckDim = FALSE )
Return TRUE on successful exit and FALSE on failure.
EX1
#include <Control.h> #include <ocImgLT.h> #include <image_utils.h> #include <..\originlab\ImageControl.h> void MatrixObject_SetDIB_Ex1(ImageControlBase &ICB, pBITMAPHANDLE pLBmp) { BITMAPHANDLE lbmpTemp; if(NULL == pLBmp) { pBITMAPHANDLE pLbmp = ICB.GetBitmapHandlePtr(); if(pLbmp) { L_CopyBitmap(&lbmpTemp, pLbmp, sizeof(BITMAPHANDLE)); pLBmp = &lbmpTemp; } else { error_report("failed to GetBitmapHandlePtr"); return; } } HDIB h = L_ChangeToDIB(pLBmp); MatrixLayer ml = Project.ActiveLayer(); if(ml) { MatrixObject mo = ml.MatrixObjects(0); if(mo.SetDIB(L_ChangeToDIB(pLBmp))) printf("succeed to set"); else printf("failed to set"); } }
MatrixObject::GetDIB
origin.h