.. index:: 
  !Image.pad Method
  
.. _id3_face_image_pad_class_method:

===============================================================================
Image.pad Method
===============================================================================

Module: :ref:`Image<id3_face_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:`FaceException<id3_face_face_exception>`
          An error has occurred during Face 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:`FaceException<id3_face_face_exception>`
          An error has occurred during Face 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:`FaceException<id3_face_face_exception>`
          An error has occurred during Face 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 FaceException

      **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:`FaceException<id3_face_face_exception>`
          An error has occurred during Face 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:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


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

      .. code:: C

        int id3FaceImage_Pad (
            ID3_FACE_IMAGE hImage, 
            int top, 
            int left, 
            int bottom, 
            int right, 
            int colorRed, 
            int colorGreen, 
            int colorBlue)

      **Parameters**

        .. line-block::

          ``hImage`` :ref:`ID3_FACE_IMAGE<id3_face_image_class>`
          :guilabel:`in` Handle to the Image 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:`id3FaceError<id3_face_face_error_enum>` file for the list of possible error codes.


