L_BOOL LBitmapWindow::SetAutoRgnToFloater(bAutoRgnToFloater)
Enables or disables the automatic creation of a floater from a region.
Flag that indicates whether to enable or disable the automatic creation of a floater from a region. Possible values are:
Value | Meaning |
---|---|
TRUE | [1] Enable the automatic creation of a floater from the region. This is the default value. |
FALSE | [0] Disable the automatic creation of a floater from the region. |
The previous setting.
Value | Meaning |
---|---|
TRUE | The previous setting was TRUE. |
FALSE | The previous setting was FALSE. |
The view perspective is always TOP_LEFT.
If you move the floater, the original region remains unchanged.
This member function does not affect the creation of floaters using the TOOL_REGION tool. This function only affects the behavior of the LBitmapRgn functions on the LBitmapWindow().
To create a floater programmatically with no region, do the following:
RECT Rect={10,20,50,100};
m_BitmapWindow.SetAutoRgnToFloater(TRUE);
LBitmapRgn Region(&m_BitmapWindow);
Region.SetRgnRect(&Rect);
To create a region programmatically with no floater, do the following:
RECT Rect={10,20,50,100};
m_BitmapWindow.SetAutoRgnToFloater(FALSE);
LBitmapRgn Region(&m_BitmapWindow);
Region.SetRgnRect(&Rect);
Win32, x64.
L_INT LBitmapWindow__SetAutoRgnToFloaterExample(HWND m_hWnd)
{
L_INT nRet;
LBitmapWindow *pBitmapWindow = new(LBitmapWindow);
LBitmapRgn *pBitmapRgn = new(LBitmapRgn);
RECT rRgnBounds, myRect;
L_BOOL bIsValid;
L_BOOL bAutoRgnToFloater;
L_BOOL bBitmapHasRgn;
L_BOOL bHasRgn;
L_BOOL bHasFloater;
L_TCHAR szTemp[500], szOutput[500];
HRGN hRgn;
pBitmapWindow->EnableAutoPaint(TRUE);
pBitmapWindow->SetWndHandle(m_hWnd);
nRet =pBitmapWindow->Load(MAKE_IMAGE_PATH(TEXT("image1.cmp")));
if(nRet !=SUCCESS)
return nRet;
pBitmapWindow->SetAutoRgnToFloater (TRUE);
pBitmapRgn->SetBitmap(pBitmapWindow);
RECT Rect={10,20,50,100};
//set the rect as a region
nRet =pBitmapRgn->SetRgnRect(&Rect);
if(nRet !=SUCCESS)
return nRet;
bIsValid = pBitmapRgn->IsValid();
bAutoRgnToFloater = pBitmapWindow->GetAutoRgnToFloater();
bBitmapHasRgn = pBitmapRgn->BitmapHasRgn();
bHasRgn = pBitmapWindow->HasRgn();
bHasFloater = pBitmapWindow->HasFloater();
pBitmapRgn->GetRgnBounds(&rRgnBounds);
wsprintf( szOutput,
TEXT("[%d]pBitmapRgn->IsValid()\n[%d]pBitmapWindow->GetAutoRgnToFloater()\n[%d]pBitmapRgn->BitmapHasRgn()\n[%d]pBitmapWindow->HasRgn()\n[%d]pBitmapWindow->HasFloater()\npBitmapRgn->GetRgnBounds(%d, %d, %d, %d)\n\n"),
bIsValid,
bAutoRgnToFloater,
bBitmapHasRgn,
bHasRgn,
bHasFloater,
rRgnBounds.left,
rRgnBounds.top,
rRgnBounds.right,
rRgnBounds.bottom
);
hRgn = pBitmapWindow->GetFloaterRgn(FLOAT_RGN_TRANS_NONE);
GetRgnBox(hRgn, &myRect);
wsprintf(szTemp, TEXT("%spBitmapWindow->GetFloaterRgn(FLOAT_RGN_TRANS_NONE) (%d, %d, %d, %d)\n"),
szOutput,
myRect.left,
myRect.top,
myRect.right,
myRect.bottom);
lstrcpy(szOutput, szTemp);
hRgn = pBitmapWindow->GetFloaterRgn (FLOAT_RGN_TRANS_FROM_WINDOW); //bombs
GetRgnBox(hRgn, &myRect);
wsprintf(szTemp, TEXT("%spBitmapWindow->GetFloaterRgn(FLOAT_RGN_TRANS_FROM_WINDOW) (%d, %d, %d, %d)\n"),
szOutput,
myRect.left,
myRect.top,
myRect.right,
myRect.bottom);
lstrcpy(szOutput, szTemp);
AfxMessageBox(szOutput);
pBitmapWindow->SetWndHandle(NULL);
return SUCCESS;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document