IPXC_Document::AddImageFromFile Method

From PDF XChange PDF SDK
Jump to: navigation, search
(Automatic page editing by robot)
 
m (Automatic page editing by robot)
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
__NOTOC__
 
[[Category:Editor]]
 
[[Category:Editor]]
 
{{#customTitle:IPXC_Document::AddImageFromFile Method}}
 
{{#customTitle:IPXC_Document::AddImageFromFile Method}}
 +
{{#parentPage:PXV:IPXC_Document#Methods|AddImageFromFile|method}}
 +
{{ToReview}}
  
The method of interface of PDF-XChange Editor SDK.
+
Adds new image to the document from specified image file. Image data compressed based on image type (monochrome, indexed, true color) and corresponding [[PXV:IPXS_EncodeFiltersArray|encoder array]].
  
 
== Syntax ==
 
== Syntax ==
<pre class="brush:cpp;gutter:false">HRESULT AddImageFromFile([in] BSTR sFileName, [in, optional] ULONG nPage, [in, optional] ULONG nFlags, [out, retval] IPXC_Image** ppImage);</pre>
+
<pre class="brush:cpp;gutter:false">HRESULT AddImageFromFile([in]                   LPWSTR        sFileName,
 +
                        [in, defaultvalue(0)] ULONG         nPage,
 +
                        [in, defaultvalue(0)] ULONG         nFlags,
 +
                        [out, retval]         IPXC_Image** pImage);</pre>
  
 
== Parameters ==
 
== Parameters ==
;''sFileName''
+
;sFileName
:[in] Value of BSTR.
+
:[in] Specifies a full file name of the image file. The file should be an image in one of supported format: <tt>BMP</tt>, <tt>PNG</tt>, <tt>GIF</tt>, <tt>ICO</tt>, <tt>PBM</tt>, <tt>PGM</tt>, <tt>PPM</tt>, <tt>JBIG</tt>, <tt>JBIG2</tt>, <tt>JPEG</tt>, <tt>JPEG2000</tt>, <tt>PXC</tt>, <tt>DCX</tt>, <tt>TGA</tt> or <tt>TIFF</tt>.
;''nPage''
+
;nPage
:[in, optional] Value of ULONG.
+
:[in, defaultvalue(0)] Specifies the 0-based page number of multipaged image formats (like, <tt>TIFF</tt> or <tt>ICO</tt>) that should be taken.
;''nFlags''
+
;nFlags
:[in, optional] Value of ULONG.
+
:[in, defaultvalue(0)] Specifies additional [[PXV:PXC_ImageToXObjectFlags|flags]] of image creation.
;''ppImage''
+
;pImage
:[out, retval] Pointer to [[PXV:IPXC_Image|IPXC_Image]].
+
:[out, retval] Returns a [[PXV:IPXC_Image|IPXC_Image]] object if new image was successfully added.
  
 
== Return Value ==
 
== Return Value ==
Returns S_OK if operation was successful or error code in other cases.
+
Returns <tt>S_OK</tt> if operation was successful or error code in other cases.
  
 
== See Also ==
 
== See Also ==
See also [[PXV:IPXC_Document|IPXC_Document]].
+
[[PXV:IPXC_Document|IPXC_Document]]

Latest revision as of 00:07, 1 December 2017


Adds new image to the document from specified image file. Image data compressed based on image type (monochrome, indexed, true color) and corresponding encoder array.

Syntax

HRESULT AddImageFromFile([in]                   LPWSTR        sFileName,
                         [in, defaultvalue(0)]  ULONG         nPage,
                         [in, defaultvalue(0)]  ULONG         nFlags,
                         [out, retval]          IPXC_Image**  pImage);

Parameters

sFileName
[in] Specifies a full file name of the image file. The file should be an image in one of supported format: BMP, PNG, GIF, ICO, PBM, PGM, PPM, JBIG, JBIG2, JPEG, JPEG2000, PXC, DCX, TGA or TIFF.
nPage
[in, defaultvalue(0)] Specifies the 0-based page number of multipaged image formats (like, TIFF or ICO) that should be taken.
nFlags
[in, defaultvalue(0)] Specifies additional flags of image creation.
pImage
[out, retval] Returns a IPXC_Image object if new image was successfully added.

Return Value

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

See Also

IPXC_Document