.. index:: 
  !DocumentImage.toRawBuffer Method
  
.. _id3_document_document_image_to_raw_buffer_class_method:

===============================================================================
DocumentImage.toRawBuffer Method
===============================================================================

Module: :ref:`DocumentImage<id3_document_document_image_class>`

Definition
----------

Copies image pixels in the specified format into a buffer.


.. tab-set::

    .. tab-item:: Python
      :sync: Python

      .. code:: Python

        to_raw_buffer(self, pixel_format: PixelFormat, buffer: ImageBuffer) -> None

      **Parameters**

        .. line-block::

          ``pixel_format`` :ref:`PixelFormat<id3_document_pixel_format_enum>`
          :guilabel:`in` The pixel format.

          ``buffer`` :ref:`ImageBuffer<id3_document_image_buffer_class>`
          :guilabel:`in` Buffer that receives the raw image data.


      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: Dart
      :sync: Dart

      .. code:: Dart

        void toRawBuffer(PixelFormat pixelFormat, ImageBuffer buffer)

      **Parameters**

        .. line-block::

          ``pixelFormat`` :ref:`PixelFormat<id3_document_pixel_format_enum>`
          :guilabel:`in` The pixel format.

          ``buffer`` :ref:`ImageBuffer<id3_document_image_buffer_class>`
          :guilabel:`in` Buffer that receives the raw image data.


      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: C#
      :sync: C#

      .. code:: C#

        public void ToRawBuffer(PixelFormat pixelFormat, ImageBuffer buffer)

      **Parameters**

        .. line-block::

          ``pixelFormat`` :ref:`PixelFormat<id3_document_pixel_format_enum>`
          :guilabel:`in` The pixel format.

          ``buffer`` :ref:`ImageBuffer<id3_document_image_buffer_class>`
          :guilabel:`in` Buffer that receives the raw image data.


      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: Java
      :sync: Java

      .. code:: Java

        public void toRawBuffer(PixelFormat pixelFormat, ImageBuffer buffer) throws DocumentException

      **Parameters**

        .. line-block::

          ``pixelFormat`` :ref:`PixelFormat<id3_document_pixel_format_enum>`
          :guilabel:`in` The pixel format.

          ``buffer`` :ref:`ImageBuffer<id3_document_image_buffer_class>`
          :guilabel:`in` Buffer that receives the raw image data.


      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: Swift
      :sync: Swift

      .. code:: Swift

        public func toRawBuffer(pixelFormat: PixelFormat, buffer: ImageBuffer) throws

      **Parameters**

        .. line-block::

          ``pixelFormat`` :ref:`PixelFormat<id3_document_pixel_format_enum>`
          :guilabel:`in` The pixel format.

          ``buffer`` :ref:`ImageBuffer<id3_document_image_buffer_class>`
          :guilabel:`in` Buffer that receives the raw image data.


      **Exceptions**

        .. line-block::

          :ref:`DocumentException<id3_document_document_exception>`
          An error has occurred during Document Library execution.


    .. tab-item:: C
      :sync: C

      .. code:: C

        int id3DocumentImage_ToRawBuffer (
            ID3_DOCUMENT_IMAGE hDocumentImage, 
            id3DocumentPixelFormat ePixelFormat, 
            ID3_DOCUMENT_IMAGE_BUFFER hBuffer)

      **Parameters**

        .. line-block::

          ``hDocumentImage`` :ref:`ID3_DOCUMENT_IMAGE<id3_document_document_image_class>`
          :guilabel:`in` Handle to the DocumentImage object.

          ``ePixelFormat`` :ref:`id3DocumentPixelFormat<id3_document_pixel_format_enum>`
          :guilabel:`in` The pixel format.

          ``hBuffer`` :ref:`ID3_DOCUMENT_IMAGE_BUFFER<id3_document_image_buffer_class>`
          :guilabel:`in` Buffer that receives the raw image data.


      **Returns**

        .. line-block::

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


