LBitmapWindow::Repaint

Summary

Repaints the class object's window. Only the specified rectangle will be repainted.

Syntax

#include "ltwrappr.h"

L_VOID LBitmapWindow::Repaint(pRect=NULL)

Parameters

LPRECT pRect

Pointer to a rectangle structure that describes the rectangle to be repainted. Pass NULL to repaint the entire window.

Returns

None.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Example

L_INT LBitmapWindow__RepaintExample(HWND hWndParent) 
{ 
   L_INT nRet; 
   LBitmapWindow  LeadBWnd ; 
   L_UINT         uZoomMode ; 
   RECT           rectZoom ; 
    
   nRet = LeadBWnd.Load(MAKE_IMAGE_PATH(TEXT("image1.cmp"))); 
   if (nRet == SUCCESS) 
   { 
      if (LeadBWnd.CreateWnd(hWndParent, TRUE, 0, 0, 100, 100) == NULL) 
         return 0; 
    
      if (LeadBWnd.IsAutoPaintEnabled() == FALSE) 
      { 
         // stop paint 
         LeadBWnd.EnableAutoPaint(TRUE) ; 
      } 
 
      /* repaint the image, but paint stopped,  
         then the Repaint will not paint the image */ 
      LeadBWnd.Repaint() ; 
 
      // start paint with new updates 
      LeadBWnd.EnableAutoPaint(FALSE) ; 
      // repaint the image 
      LeadBWnd.Repaint() ; 
 
      // get zoom mode for current bitmap window  
      uZoomMode = LeadBWnd.GetZoomMode(); 
      if (uZoomMode != ZOOM_FACTOR) 
      { 
         uZoomMode = ZOOM_FITHEIGHT ; 
         // change the zoom mode for current bitmap window  
         nRet =LeadBWnd.SetZoomMode(uZoomMode) ; 
         if(nRet !=SUCCESS) 
            return nRet; 
      } 
 
      //... 
      //... 
 
      if (LeadBWnd.GetHorzLineStep() != 2) 
         LeadBWnd.SetHorzLineStep(2) ; 
 
      if (LeadBWnd.GetVertLineStep() != 2) 
         LeadBWnd.SetVertLineStep(2) ; 
 
      // check if auto scroll bars is enable or not  
      if (LeadBWnd.IsAutoScrollEnabled() == FALSE) 
         LeadBWnd.EnableAutoScroll(TRUE) ; 
 
      // fill zoom rect to use it in ZoomToRect  
      rectZoom.left  = 50 ; 
      rectZoom.top   = 50 ; 
      rectZoom.right = 75 ; 
      rectZoom.bottom= 75 ; 
 
      nRet =LeadBWnd.ZoomToRect(rectZoom) ; 
      if(nRet !=SUCCESS) 
         return nRet; 
 
      //... 
      //... 
 
      // use ScrollBars (Horizontal & Vertical) 
       
      // 10 = the distance to scroll the bitmap horizontally. 
      // 20 = the distance to scroll the bitmap horizontally. 
      LeadBWnd.ScrollBy( 10, 20) ; 
       
      // go to 10 position on horizontal scroll in bitmap 
      // go to 20 position on vertical scroll in bitmap 
      LeadBWnd.ScrollTo( 10, 20) ; 
   } 
   else 
      return nRet; 
 
   return SUCCESS ; 
 
} 
Help Version 22.0.2023.2.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

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