Package org.aoju.bus.core.image.element
Class TextElement
java.lang.Object
org.aoju.bus.core.image.element.AbstractElement<TextElement>
org.aoju.bus.core.image.element.TextElement
文本元素
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
ConstructorsConstructorDescriptionTextElement(String text, int fontSize, int x, int y) TextElement(String text, Font font, int x, int y) TextElement(String text, String fontName, int fontSize, int x, int y) -
Method Summary
Modifier and TypeMethodDescriptiongetColor()getFont()intintintgetText()booleanbooleansetAutoBreakLine(boolean autoBreakLine) setAutoBreakLine(int maxLineWidth, int maxLineCount, int lineHeight) 设置自动换行setColor(int r, int g, int b) setLineHeight(int lineHeight) setMaxLineCount(int maxLineCount) setMaxLineWidth(int maxLineWidth) setStrikeThrough(boolean strikeThrough)
-
Constructor Details
-
TextElement
- Parameters:
text- 文本内容font- Font对象x- x坐标y- y坐标
-
TextElement
- Parameters:
text- 文本内容fontSize- 字号x- x坐标y- y坐标
-
TextElement
- Parameters:
text- 文本内容fontName- 字体名称fontSize- 字号x- x坐标y- y坐标
-
-
Method Details
-
setAutoBreakLine
设置自动换行- Parameters:
maxLineWidth- 最大宽度(超出则换行)maxLineCount- 最大行数(超出则丢弃)lineHeight- 行高- Returns:
- 当前对象
-
getText
-
setText
-
getFont
-
setFont
-
getColor
-
setColor
-
setColor
-
isStrikeThrough
public boolean isStrikeThrough() -
setStrikeThrough
-
isAutoBreakLine
public boolean isAutoBreakLine() -
setAutoBreakLine
-
getMaxLineWidth
public int getMaxLineWidth() -
setMaxLineWidth
-
getMaxLineCount
public int getMaxLineCount() -
setMaxLineCount
-
getLineHeight
public int getLineHeight() -
setLineHeight
-
getRotate
-
setRotate
-