.. index:: 
  !DocumentImage.reallocate Method
  
.. _id3_document_document_image_reallocate_class_method:

===============================================================================
DocumentImage.reallocate Method
===============================================================================

Module: :ref:`DocumentImage<id3_document_document_image_class>`

Definition
----------

Reallocates the internal memory of the Image from parameters.

.. note:: If the given parameters are the same as the ones of the object, then there is nothing done in this function.


.. tab-set::

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

      .. code:: Python

        reallocate(self, width: int, height: int, pixel_format: PixelFormat) -> None

      **Parameters**

        .. line-block::

          ``width`` int
          :guilabel:`in` The new width, in pixels.

          ``height`` int
          :guilabel:`in` The new height, in pixels.

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


      **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 reallocate(int width, int height, PixelFormat pixelFormat)

      **Parameters**

        .. line-block::

          ``width`` int
          :guilabel:`in` The new width, in pixels.

          ``height`` int
          :guilabel:`in` The new height, in pixels.

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


      **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 Reallocate(int width, int height, PixelFormat pixelFormat)

      **Parameters**

        .. line-block::

          ``width`` int
          :guilabel:`in` The new width, in pixels.

          ``height`` int
          :guilabel:`in` The new height, in pixels.

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


      **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 reallocate(int width, int height, PixelFormat pixelFormat) throws DocumentException

      **Parameters**

        .. line-block::

          ``width`` int
          :guilabel:`in` The new width, in pixels.

          ``height`` int
          :guilabel:`in` The new height, in pixels.

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


      **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 reallocate(width: Int32, height: Int32, pixelFormat: PixelFormat) throws

      **Parameters**

        .. line-block::

          ``width`` Int32
          :guilabel:`in` The new width, in pixels.

          ``height`` Int32
          :guilabel:`in` The new height, in pixels.

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


      **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_Reallocate (
            ID3_DOCUMENT_IMAGE hDocumentImage, 
            int width, 
            int height, 
            id3DocumentPixelFormat ePixelFormat)

      **Parameters**

        .. line-block::

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

          ``width`` int
          :guilabel:`in` The new width, in pixels.

          ``height`` int
          :guilabel:`in` The new height, in pixels.

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


      **Returns**

        .. line-block::

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


