IIXC_Inst::Page_CreateFromMemory Method

From PDF XChange PDF SDK
Jump to: navigation, search
m (Automatic page editing by robot)
Line 5: Line 5:
 
{{ToReview}}
 
{{ToReview}}
  
The method of interface of PDF-XChange Editor SDK.
+
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 ==
 
== Syntax ==
Line 21: Line 21:
 
== Parameters ==
 
== Parameters ==
 
;Width
 
;Width
:[in]  Value of ULONG.
+
:[in]  Specifies the real width of the image in pixels. This value must be positive.
 
;Height
 
;Height
:[in]  Value of ULONG.
+
:[in]  Specifies the real height of the image in pixels. This value must be positive.
 
;memType
 
;memType
:[in]  Value of [[PXV:IXC_MemoryType|IXC_MemoryType]].
+
:[in]  Value of [[PXV:IXC_MemoryType|IXC_MemoryType]] specifies the image type.
 
;numColors
 
;numColors
:[in]  Value of ULONG.
+
:[in]  Specifies the length of the palette array. If palette is NULL, palcount must be set to a value of 0.
 
;palette
 
;palette
:[in]  Pointer to ULONG.
+
:[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
 
;pData
:[in]  Pointer to UCHAR.
+
:[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
 
;nOffset
:[in]  Value of LONG.
+
:[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.
 
;dataSize
 
;dataSize
:[in]  Value of ULONG.
+
:[in]  Specifies the length of the data.
 
;nFlags
 
;nFlags
 
:[in]  Value of ULONG.
 
:[in]  Value of ULONG.
 
;ppPage
 
;ppPage
:[out, retval]  Pointer to [[PXV:IIXC_Page|IIXC_Page]].
+
:[out, retval]  Pointer to [[PXV:IIXC_Page|IIXC_Page]] variable that receives the handle of created page.
  
 
== Return Value ==
 
== Return Value ==
 
Returns S_OK if operation was successful or error code in other cases.
 
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 ==
 
== See Also ==
See also [[PXV:IIXC_Inst|IIXC_Inst]].
+
:[[PXV:IIXC_Inst|IIXC_Inst]].
 +
:[[PXV:IXC_MemoryType|IXC_MemoryType]]

Revision as of 02:29, 30 April 2015


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           Width,
                              [in]           ULONG           Height,
                              [in]           IXC_MemoryType  memType,
                              [in]           ULONG           numColors,
                              [in]           ULONG*          palette,
                              [in]           UCHAR*          pData,
                              [in]           LONG            nOffset,
                              [in]           ULONG           dataSize,
                              [in]           ULONG           nFlags,
                              [out, retval]  IIXC_Page**     ppPage);

Parameters

Width
[in] Specifies the real width of the image in pixels. This value must be positive.
Height
[in] Specifies the real height of the image in pixels. This value must be positive.
memType
[in] Value of IXC_MemoryType specifies the image type.
numColors
[in] Specifies the length of the palette array. If palette is NULL, palcount must be set to a value of 0.
palette
[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.
dataSize
[in] Specifies the length of the data.
nFlags
[in] Value of ULONG.
ppPage
[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.
IXC_MemoryType