IIXC_Inst::Page_CreateFromMemory Method

From PDF XChange PDF SDK
Jump to: navigation, search


The method creates a new page from the contents of a memory buffer. The memory data can be present as raw data or as compressed data (currently RLE4 and RLE8 compression methods are supported).

Syntax

HRESULT Page_CreateFromMemory([in]           ULONG           nWidth,
                              [in]           ULONG           nHeight,
                              [in]           IXC_MemoryType  nMemType,
                              [in]           ULONG           nNumColors,
                              [in]           ULONG*          pPalette,
                              [in]           UCHAR*          pData,
                              [in]           LONG            nOffset,
                              [in]           ULONG           nDataSize,
                              [in]           ULONG           nFlags,
                              [out, retval]  IIXC_Page**     pPage);

Parameters

nWidth
[in] Specifies the real width of the image in pixels. This value must be positive.
nHeight
[in] Specifies the real height of the image in pixels. This value must be positive.
nMemType
[in] Value of IXC_MemoryType specifies the image type.
nNumColors
[in] Specifies the length of the palette array. If palette is NULL, palcount must be set to a value of 0.
pPalette
[in] Specifies the pointer to the image palette. The palette consists of an array of palcount RGBQUAD elements. The length of palette depends on the memtype. For some image types this parameter may be NULL.
pData
[in] Specifies the image data. This parameter cannot be NULL. The length of this buffer must be sufficient to contain all the image data and depends on the width, height and memtype.
nOffset
[in] This parameter specifies the length in bytes of one row of the image. For all image types, except MemoryType_4RLE and MemoryType_8RLE, this parameter cannot be 0. If the data is a pointer to the last image row (the image is flipped type, for example, .BMP), stride must be expressed as a negative value. The function will increment the data pointer with a stride value to seek the next line in the image, so this parameter may be negative.
nDataSize
[in] Specifies the length of the data.
nFlags
[in] Value of ULONG.
pPage
[out, retval] Pointer to IIXC_Page variable that receives the handle of created page.

Return Value

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

Remarks

Note:
Should any of the specified parameters be incorrect (for example, the specified data buffer is too small) the function may well cause the application to fail and care should be exercised that all required parameters are properly defined to ensure stability within your application.

See Also

IIXC_Inst