LBitmapWindow::SetAutoRgnToFloater

#include "ltwrappr.h"

L_BOOL LBitmapWindow::SetAutoRgnToFloater(bAutoRgnToFloater)

Enables or disables the automatic creation of a floater from a region.

Parameters

L_BOOL bAutoRgnToFloater

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.

Returns

The previous setting.

Value Meaning
TRUE The previous setting was TRUE.
FALSE The previous setting was FALSE.

Comments

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); 

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

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 Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.