com.aspose.barcode

Class Margins



  • public class Margins
    extends Object

    Specifies the margins of a barcode image.


    This class is used to manipulate margins in barcode image.

    Note: The actual amount of the margins are determined by the specified mesure System.Drawing.GraphicsUnitunit of the barcode image.

    Margins.LeftLeft, Margins.RightRight}, Margins.TopTop, and Margins.BottomBottom} are properties that define the margins.

    Margins.EqualsEquals determines if another object is equal to a Margins object.

    • Method Summary

      Methods 
      Modifier and Type Method and Description
      boolean equals(Object obj)
      Determines whether two Margins} instances are equal.
      int getBottom()
      Gets the bottom marign.
      int getLeft()
      Gets the left margin.
      int getRight()
      Gets the right margin.
      int getTop()
      Gets the top marign.
      int hashCode()
      Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
      void set(int margin)
      Sets the specified margin for all sides.
      void set(int left, int right, int top, int bottom)
      Sets the specified margins.
      void setBottom(int value)
      Sets the bottom marign.
      void setLeft(int value)
      Sets the left margin.
      void setRight(int value)
      Sets the right margin.
      void setTop(int value)
      Sets the top marign.
      String toString()
      Returns a String that represents the current MarginsMargins} instance.
    • Method Detail

      • set

        public void set(int margin)

        Sets the specified margin for all sides.

        Parameters:
        margin - The margin for all sides.
      • set

        public void set(int left,
               int right,
               int top,
               int bottom)

        Sets the specified margins.

        Parameters:
        left - The left side.
        right - The right side.
        top - The top side.
        bottom - The bottom side.
      • equals

        public boolean equals(Object obj)

        Determines whether two Margins} instances are equal.

        Overrides:
        equals in class Object
        Parameters:
        obj - The Margins} instance on the left
        Returns:
        true if the left Margins instances is equal to the right one; otherwise, false.
      • hashCode

        public int hashCode()

        Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.

        Overrides:
        hashCode in class Object
        Returns:
        A hash code for the current Object.
      • toString

        public String toString()

        Returns a String that represents the current MarginsMargins} instance.

        Overrides:
        toString in class Object
        Returns:
        A System.StringString that represents the current Object.
      • getBottom

        public int getBottom()

        Gets the bottom marign.

        Throws:
        com.aspose.ms.System.ArgumentException -

        The bottom parameter value is less than 0.

      • setBottom

        public void setBottom(int value)

        Sets the bottom marign.

        Throws:
        com.aspose.ms.System.ArgumentException -

        The bottom parameter value is less than 0.

      • getLeft

        public int getLeft()

        Gets the left margin.

        Throws:
        com.aspose.ms.System.ArgumentException -

        The Left parameter value is less than 0.

      • setLeft

        public void setLeft(int value)

        Sets the left margin.

        Throws:
        com.aspose.ms.System.ArgumentException -

        The Left parameter value is less than 0.

      • getRight

        public int getRight()

        Gets the right margin.

        Throws:
        com.aspose.ms.System.ArgumentException -

        The Right parameter value is less than 0.

      • setRight

        public void setRight(int value)

        Sets the right margin.

        Throws:
        com.aspose.ms.System.ArgumentException -

        The Right parameter value is less than 0.

      • getTop

        public int getTop()

        Gets the top marign.

        Throws:
        com.aspose.ms.System.ArgumentException -

        The Top parameter value is less than 0.

      • setTop

        public void setTop(int value)

        Sets the top marign.

        Throws:
        com.aspose.ms.System.ArgumentException -

        The Top parameter value is less than 0.