Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
Toggle table of contents sidebar

# DocumentImage.set Method

Module: DocumentImage

## Definition

Sets the Image object fields.

Warning

This function does not allocate any memory and is unsafe! The user must handle the pixels pointer carefully.

C#

    public static DocumentImage Set(int width, int height, PixelFormat pixelFormat, IntPtr pixels)

Parameters

> `width` int
> in The width, in pixels, of the image.
> `height` int
> in The height, in pixels, of the image.
> `pixelFormat` PixelFormat
> in The pixel format of the image.
> `pixels` IntPtr
> in A pointer to the image pixels of the image.

Returns

> DocumentImage
> The newly created document image.

Exceptions

> DocumentException
> An error has occurred during Document Library execution.

C

    int id3DocumentImage_Set (
        ID3_DOCUMENT_IMAGE hDocumentImage,
        int width,
        int height,
        id3DocumentPixelFormat ePixelFormat,
        void * pixels)

Parameters

> `hDocumentImage` ID3_DOCUMENT_IMAGE
> in Handle to the DocumentImage object.
> `width` int
> in The width, in pixels, of the image.
> `height` int
> in The height, in pixels, of the image.
> `ePixelFormat` id3DocumentPixelFormat
> in The pixel format of the image.
> `pixels` void *
> in A pointer to the image pixels of the image.

Returns

> `int`
> An error code.
> See id3DocumentError file for the list of possible error codes.