.. index:: 
  !DocumentImage.pad Method
  
.. _id3_document_document_image_pad_class_method:

===============================================================================
DocumentImage.pad Method
===============================================================================

Module: :ref:`DocumentImage<id3_document_document_image_class>`

Definition
----------

Add padding around the image

Only works for BGR 24 bits, RGB 24 bits and Grayscale 8bits images.

For grayscale image, the padding color is the red component.


.. tab-set::

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

      .. code:: Python

        pad(self, top: int, left: int, bottom: int, right: int, color_red: int, color_green: int, color_blue: int) -> None

      **Parameters**

        .. line-block::

          ``top`` int
          :guilabel:`in` Padding on top.

          ``left`` int
          :guilabel:`in` Padding on left.

          ``bottom`` int
          :guilabel:`in` Padding on bottom.

          ``right`` int
          :guilabel:`in` Padding on right.

          ``color_red`` int
          :guilabel:`in` Padding color red (from 0 to 255)

          ``color_green`` int
          :guilabel:`in` Padding color green (from 0 to 255)

          ``color_blue`` int
          :guilabel:`in` Padding color blue (from 0 to 255)


      **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 pad(int top, int left, int bottom, int right, int colorRed, int colorGreen, int colorBlue)

      **Parameters**

        .. line-block::

          ``top`` int
          :guilabel:`in` Padding on top.

          ``left`` int
          :guilabel:`in` Padding on left.

          ``bottom`` int
          :guilabel:`in` Padding on bottom.

          ``right`` int
          :guilabel:`in` Padding on right.

          ``colorRed`` int
          :guilabel:`in` Padding color red (from 0 to 255)

          ``colorGreen`` int
          :guilabel:`in` Padding color green (from 0 to 255)

          ``colorBlue`` int
          :guilabel:`in` Padding color blue (from 0 to 255)


      **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 Pad(int top, int left, int bottom, int right, int colorRed, int colorGreen, int colorBlue)

      **Parameters**

        .. line-block::

          ``top`` int
          :guilabel:`in` Padding on top.

          ``left`` int
          :guilabel:`in` Padding on left.

          ``bottom`` int
          :guilabel:`in` Padding on bottom.

          ``right`` int
          :guilabel:`in` Padding on right.

          ``colorRed`` int
          :guilabel:`in` Padding color red (from 0 to 255)

          ``colorGreen`` int
          :guilabel:`in` Padding color green (from 0 to 255)

          ``colorBlue`` int
          :guilabel:`in` Padding color blue (from 0 to 255)


      **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 pad(int top, int left, int bottom, int right, int colorRed, int colorGreen, int colorBlue) throws DocumentException

      **Parameters**

        .. line-block::

          ``top`` int
          :guilabel:`in` Padding on top.

          ``left`` int
          :guilabel:`in` Padding on left.

          ``bottom`` int
          :guilabel:`in` Padding on bottom.

          ``right`` int
          :guilabel:`in` Padding on right.

          ``colorRed`` int
          :guilabel:`in` Padding color red (from 0 to 255)

          ``colorGreen`` int
          :guilabel:`in` Padding color green (from 0 to 255)

          ``colorBlue`` int
          :guilabel:`in` Padding color blue (from 0 to 255)


      **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 pad(top: Int32, left: Int32, bottom: Int32, right: Int32, colorRed: Int32, colorGreen: Int32, colorBlue: Int32) throws

      **Parameters**

        .. line-block::

          ``top`` Int32
          :guilabel:`in` Padding on top.

          ``left`` Int32
          :guilabel:`in` Padding on left.

          ``bottom`` Int32
          :guilabel:`in` Padding on bottom.

          ``right`` Int32
          :guilabel:`in` Padding on right.

          ``colorRed`` Int32
          :guilabel:`in` Padding color red (from 0 to 255)

          ``colorGreen`` Int32
          :guilabel:`in` Padding color green (from 0 to 255)

          ``colorBlue`` Int32
          :guilabel:`in` Padding color blue (from 0 to 255)


      **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_Pad (
            ID3_DOCUMENT_IMAGE hDocumentImage, 
            int top, 
            int left, 
            int bottom, 
            int right, 
            int colorRed, 
            int colorGreen, 
            int colorBlue)

      **Parameters**

        .. line-block::

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

          ``top`` int
          :guilabel:`in` Padding on top.

          ``left`` int
          :guilabel:`in` Padding on left.

          ``bottom`` int
          :guilabel:`in` Padding on bottom.

          ``right`` int
          :guilabel:`in` Padding on right.

          ``colorRed`` int
          :guilabel:`in` Padding color red (from 0 to 255)

          ``colorGreen`` int
          :guilabel:`in` Padding color green (from 0 to 255)

          ``colorBlue`` int
          :guilabel:`in` Padding color blue (from 0 to 255)


      **Returns**

        .. line-block::

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


