L_Doc2SetPaintZoomFactorExt

#include "ltdoc2.h"

L_LTDOC2_API L_INT L_Doc2SetPaintZoomFactorExt(hDoc, nDocId, nPageIndex, fZoomFactor)

Sets the zoom factor used to draw the specified OCR page.

Parameters

L_HDOC2 hDoc

Handle to the OCR document.

L_INT nDocId

Document ID created by calling L_Doc2CreateDocument.

L_INT nPageIndex

Zero-based index of the page for which to set the zoom factor.

L_FLOAT fZoomFactor

Specifies the zoom factor used when drawing the specified OCR page. A value of 100 represents normal display, a value of 200 represents a 2X display, a value of 50 represents a 1/2X display, etc.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

The page specified in the nPageIndex may or may not have zones. If the page has zones, the zones will be drawn using the zoom factor as well.

To draw the specified page using the specified zoom factor, call L_Doc2DrawPage / L_Doc2DrawPageExt.

To get the zoom factor for a specific page, call L_Doc2GetPaintZoomFactor / L_Doc2GetPaintZoomFactorExt.

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT Doc2SetPaintZoomFactorExampleExt(L_HDOC2 hDoc, L_INT nDocId, HWND hWnd) 
{ 
   L_INT nRet; 
   HDC hdc = NULL; 
   PAGEINFO2 PageInfo; 
   RECT rcDst; 
   L_FLOAT fZoom; 
 
   ZeroMemory(&PageInfo, sizeof(PAGEINFO2)); 
   hdc = GetDC(hWnd); 
 
   nRet = L_Doc2SetActivePageExt(hDoc, nDocId, 0); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = L_Doc2GetPaintZoomFactorExt(hDoc, nDocId, 0, &fZoom); 
   if(nRet != SUCCESS) 
      return nRet; 
   if (fZoom != 100.0) 
   { 
      nRet = L_Doc2SetPaintZoomFactorExt(hDoc, nDocId, 0, 100); 
      if(nRet != SUCCESS) 
         return nRet; 
   } 
 
   nRet = L_Doc2GetPageInfoExt (hDoc, nDocId, 0, &PageInfo, sizeof(PAGEINFO2)); 
   if(nRet != SUCCESS) 
      return nRet; 
   SetRect(&rcDst, 0, 0, PageInfo.nWidth, PageInfo.nHeight); 
 
   nRet = L_Doc2DrawPageExt(hDoc, hdc, nDocId, 0, NULL, NULL, &rcDst, NULL, SRCCOPY, TRUE); 
   if(nRet != SUCCESS) 
      return nRet; 
   ReleaseDC(hWnd, hdc); 
   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 OCR Module - OmniPage Engine C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.