#include "ltdoc2.h"
L_LTDOC2_API L_INT EXT_FUNCTION L_Doc2SetPaintZoomFactor(hDoc, nPageIndex, fZoomFactor)
L_HDOC2 hDoc; |
handle to the OCR document. |
L_INT nPageIndex; |
page index |
L_FLOAT fZoomFactor; |
zoom factor |
Sets the zoom factor used to draw the specified OCR page.
Parameter |
Description |
hDoc |
Handle to the OCR document. |
nPageIndex |
Index of the page for which to set the zoom factor. This index is zero-based. |
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. |
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
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 too.
To draw the specified page, using the specified zoom factor, call the L_Doc2DrawPage function.
To get the zoom factor for a specific page, call the L_Doc2GetPaintZoomFactor function.
Required DLLs and Libraries
LTDOC2 For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
L_INT Doc2SetPaintZoomFactorExample(L_HDOC2 hDoc,HWND hWnd)
{
L_INT nRet;
HDC hdc = NULL;
PAGEINFO2 PageInfo;
RECT rcDst;
L_FLOAT fZoom;
ZeroMemory(&PageInfo, sizeof(PAGEINFO2));
hdc = GetDC(hWnd);
nRet = L_Doc2SetActivePage(hDoc, 0);
if(nRet != SUCCESS)
return nRet;
nRet = L_Doc2GetPaintZoomFactor(hDoc, 0, &fZoom);
if(nRet != SUCCESS)
return nRet;
if (fZoom != 100.0)
{
nRet = L_Doc2SetPaintZoomFactor(hDoc, 0, 100);
if(nRet != SUCCESS)
return nRet;
}
nRet = L_Doc2GetPageInfo (hDoc, 0, &PageInfo, sizeof(PAGEINFO2));
if(nRet != SUCCESS)
return nRet;
SetRect(&rcDst, 0, 0, PageInfo.nWidth, PageInfo.nHeight);
nRet = L_Doc2DrawPage(hDoc, hdc, 0, NULL, NULL, &rcDst, NULL, SRCCOPY, TRUE);
if(nRet != SUCCESS)
return nRet;
ReleaseDC(hWnd, hdc);
return SUCCESS;
}