Module bus.extra

Class ImageText

java.lang.Object
org.miaixz.bus.extra.image.ImageText
All Implemented Interfaces:
Serializable

public class ImageText extends Object implements Serializable
Represents text to be displayed, used for storing text information for drawing on an image, including content, font, size, position, and transparency.
Since:
Java 17+
Author:
Kimi Liu
See Also:
  • Constructor Details

    • ImageText

      public ImageText(String text, Color color, Font font, Point point, float alpha)
      Constructor.
      Parameters:
      text - The text content.
      color - The color of the text.
      font - The font for displaying the text.
      point - The top-left starting position.
      alpha - The transparency.
  • Method Details

    • of

      public static ImageText of(String text, Color color, Font font, Point point, float alpha)
      Builds an ImageText object.
      Parameters:
      text - The text content.
      color - The color of the text.
      font - The font for displaying the text.
      point - The top-left starting position.
      alpha - The transparency.
      Returns:
      An ImageText object.
    • getPressText

      public String getPressText()
      Gets the text content.
      Returns:
      The text content.
    • setPressText

      public void setPressText(String pressText)
      Sets the text content.
      Parameters:
      pressText - The text content.
    • getColor

      public Color getColor()
      Gets the text color.
      Returns:
      The text color.
    • setColor

      public void setColor(Color color)
      Sets the text color.
      Parameters:
      color - The text color.
    • getFont

      public Font getFont()
      Gets the font.
      Returns:
      The font.
    • setFont

      public void setFont(Font font)
      Sets the font.
      Parameters:
      font - The font.
    • getPoint

      public Point getPoint()
      Gets the 2D coordinate point.
      Returns:
      The 2D coordinate point.
    • setPoint

      public void setPoint(Point point)
      Sets the 2D coordinate point.
      Parameters:
      point - The 2D coordinate point.
    • getAlpha

      public float getAlpha()
      Gets the transparency.
      Returns:
      The transparency.
    • setAlpha

      public void setAlpha(float alpha)
      Sets the transparency.
      Parameters:
      alpha - The transparency.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object