IIXC_Page::LockPageBlock Method

From PDF XChange PDF SDK
Jump to: navigation, search

This method locks a rectangular portion of the page and provides direct access to the page's data. Any pixel data that you write to the buffer is copied to the page when you call IIXC_Page::UnlockPageBlock.

Syntax

HRESULT LockPageBlock([in]       RECT*               stRect,
                      [in]       ULONG               nFlags,
                      [in, out]  IXC_PageBlockData*  stBlockData);

Parameters

stRect
[in] Pointer to a rectangle that specifies the portion of the page to be locked.
nFlags
[in] Set of flags that specify whether the locked portion of the bitmap is available for reading or for writing and whether the caller has already allocated a buffer.
stBlockData
[in, out] Pointer to the IXC_PageBlockData structure. If the PageBlock_UserBuf flag of the flags parameter is cleared, then blockData serves only as an output parameter. In that case, the pData data member of the IXC_PageBlockData structure receives a pointer to a temporary buffer which is filled with the values of the requested pixels. The other data members of the IXC_PageBlockData structure receive attributes (width, height, and stride) of the pixel data in the temporary buffer. If the PageBlock_UserBuf flag of the flags parameter is set, then blockData serves as an input parameter (and possibly as an output parameter). In that case, the caller must allocate a buffer for the pixel data that will be read or written. The caller also must create a IXC_PageBlockData structure, set the pData data member of that IXC_PageBlockData structure to the address of the buffer, and set the other data members of the IXC_PageBlockData structure to specify the attributes (width, height, and stride) of the buffer

Return Value

Returns S_OK if operation was successful or error code in other cases.

See Also

IIXC_Page