LBitmapWindow::GetBitmapVisibleRect

#include "ltwrappr.h"

L_VOID LBitmapWindow::GetBitmapVisibleRect(pRect)

Gets the visible rectangle of the displayed bitmap.

Parameters

LPRECT pRect

Pointer to the rectangle to be updated with the visible part of the displayed bitmap.

Returns

None.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Example

L_INT LBitmapWindow__GetBitmapVisibleRectExample(HWND hWndParent)  
{ 
   L_INT nRet; 
   LBitmapWindow  LeadBWnd ; 
    
   nRet = LeadBWnd.Load(MAKE_IMAGE_PATH(TEXT("image1.cmp"))) ; 
   if (nRet == SUCCESS) 
   { 
      L_UINT         uToolType, uRgnType; 
      RECT           rect ; 
 
      if (LeadBWnd.CreateWnd( hWndParent, TRUE, 0, 0, 100, 100) == NULL) 
         return 0; 
 
      uToolType = LeadBWnd.GetToolType() ; 
      if (uToolType != TOOL_REGION) 
         LeadBWnd.SetToolType(TOOL_REGION) ; 
 
      uRgnType = LeadBWnd.GetRegionType() ; 
      if (uRgnType != REGION_TYPE_FREE_HAND) 
         LeadBWnd.SetRegionType(REGION_TYPE_FREE_HAND) ; 
 
      //... do some process  
      //... 
 
      if (LeadBWnd.HasRgn() == TRUE) 
         LeadBWnd.CancelRgn() ; 
 
      LeadBWnd.ZoomIn() ; 
      LeadBWnd.GetBitmapVisibleRect(&rect) ; 
 
      rect.left -= 10 ; 
      rect.top  -= 10 ; 
      rect.right -= 10; 
      rect.bottom-= 10; 
 
      nRet =LeadBWnd.Move(rect); 
      if(nRet !=SUCCESS) 
         return nRet; 
      LeadBWnd.FitToParent() ; 
       
      GRADIENTDLGPARAMS GradDlgParm;   
      if(LeadBWnd. DialogEffect()->DoModalGetGradient(hWndParent)==SUCCESS) 
      { 
         nRet =LeadBWnd.GetGradientParameters(&GradDlgParm); 
         if(nRet !=SUCCESS) 
            return nRet; 
         //… 
         nRet =LeadBWnd.SetGradientParameters(&GradDlgParm); 
         if(nRet !=SUCCESS) 
            return nRet; 
 
         if (LeadBWnd.GetGradientStyle() != EFX_GRADIENT_LINE2_C_TO_LT_AND_RB) 
            LeadBWnd.SetGradientStyle(EFX_GRADIENT_LINE2_C_TO_LT_AND_RB) ;         
      } 
 
      TRANSITIONDLGPARAMS   TransDlgParm;  
      if(LeadBWnd. DialogEffect()->DoModalGetTransition(hWndParent)==SUCCESS) 
      { 
         LeadBWnd.GetTransitionParameters(&TransDlgParm); 
         //… 
         LeadBWnd.SetTransitionParameters(&TransDlgParm); 
 
         if (LeadBWnd.GetTransition() != EFX_TRANS_SOLID) 
            LeadBWnd.SetTransition(EFX_TRANS_SOLID) ; 
 
         if (LeadBWnd.GetTransitionEffect() != EFX_TRANS_UPWARD_DIAG) 
            LeadBWnd.SetTransitionEffect(EFX_TRANS_UPWARD_DIAG) ; 
 
         if (LeadBWnd.GetMaxTransitionPasses() == 1) 
            LeadBWnd.SetMaxTransitionPasses(3) ; 
      } 
 
      EFFECTDLGPARAMS  EfxDlgParm; 
      if(LeadBWnd. DialogEffect()->DoModalGetEffect(hWndParent)==SUCCESS) 
      { 
         LeadBWnd.DialogEffect()->GetEffectParams(&EfxDlgParm,sizeof(EfxDlgParm)); 
         nRet =LeadBWnd.SetEffectParameters(&EfxDlgParm); 
         if(nRet !=SUCCESS) 
            return nRet; 
 
         if (LeadBWnd.GetMaxEffectPasses() == 1) 
            LeadBWnd.SetMaxEffectPasses(3) ; 
      } 
 
      if (LeadBWnd.GetPaintEffect() != EFX_EFFECT_WIPE_L_TO_R)       
         LeadBWnd.SetPaintEffect(EFX_EFFECT_WIPE_L_TO_R) ; 
 
      if (LeadBWnd.GetRgnFrameType() != RGNFRAME_STATIC) 
         LeadBWnd.SetRgnFrameType(RGNFRAME_STATIC) ; 
   } 
   else 
      return nRet; 
 
   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.