LBitmapWindow::GetBitmapVisibleRect

#include "ltwrappr.h"

L_VOID LBitmapWindow::GetBitmapVisibleRect(pRect)

LPRECT pRect;

/* pointer to the rectangle to be updated */

Gets the visible rectangle of the displayed bitmap.

Parameter

Description

pRect

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

Returns

None

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

Class Members

Example

L_INT TestFunc(HWND hWndParent) 
{
   LBitmapWindow  LeadBWnd ;

   if (LeadBWnd.Load(TEXT("image1.cmp")) == 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;
      
      LeadBWnd.Move(rect);
      LeadBWnd.FitToParent() ;    

      GRADIENTDLGPARAMS GradDlgParm;  
      if(LeadBWnd. DialogEffect()->DoModalGetGradient(hWndParent)==SUCCESS)
      {
         LeadBWnd.GetGradientParameters(&GradDlgParm);
          //…
         LeadBWnd.SetGradientParameters(&GradDlgParm);

         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));
         LeadBWnd.SetEffectParameters(&EfxDlgParm);

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

   return SUCCESS ;
}