public class Img extends Div<Img>
为了防止与Image对象命名冲突采用Img缩写
绘制行为详见渲染器 ImgRender
| 构造器和说明 |
|---|
Img(double width,
double height,
Path src)
构造图片对象
该构造器不会输入图片进行解析,直接将图片作为资源使用。
|
Img(Path src)
|
| 限定符和类型 | 方法和说明 |
|---|---|
String |
elementType()
元素类型
关联绘制器:
ImgRender |
Path |
getSrc() |
static BufferedImage |
readImage(File imageFile)
尝试读取图片文件为 BufferedImage
首先尝试采用RGB读取,如果失败那么将CMYK进行色彩空间转化为RGB。
|
Img |
setSrc(Path src) |
Div[] |
split(double sHeight)
不允许切分
|
box, clone, contentSplitAdjust, copyTo, doPrepare, getBackgroundColor, getBorder, getBorderBottom, getBorderColor, getBorderDash, getBorderLeft, getBorderRight, getBorderTop, getClear, getDisplay, getFloat, getHeight, getLayer, getLeft, getMargin, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getOnRenderFinish, getOpacity, getPadding, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getPosition, getRight, getTop, getWidth, getX, getY, heightPlus, isBlockElement, isIntegrity, isNoBorder, isPlaceholder, onRenderFinish, placeholder, placeholder, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBorder, setBorderBottom, setBorderColor, setBorderColor, setBorderColor, setBorderDash, setBorderLeft, setBorderRight, setBorderTop, setBox, setClear, setDisplay, setFloat, setHeight, setIntegrity, setLayer, setLeft, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setOpacity, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setPlaceholder, setPosition, setRight, setTop, setWidth, setX, setXY, setY, toString, widthPluspublic Img(double width,
double height,
Path src)
throws IOException
该构造器不会输入图片进行解析,直接将图片作为资源使用。
width - 图片在页面内的宽度,单位毫米(mm)height - 图片在页面内的高度,单位毫米(mm)src - 图片路径(该构造器不会解析图片大小)IOException - 读取异常@Deprecated public Img(Path src) throws IOException
图片宽度和高度以 每 5pix/mm (像素/毫米)的比例转换。
不建议使用该方式构造图片,图片的宽度和高度应该在由调用者手动指定
建议使用Img(double, double, java.nio.file.Path)方法构造
src - 图片路径IOException - 图片解析异常public static BufferedImage readImage(File imageFile) throws IOException
首先尝试采用RGB读取,如果失败那么将CMYK进行色彩空间转化为RGB。
imageFile - 图片文件IOException - 操作或转换异常public Path getSrc()
public Div[] split(double sHeight)
split 在接口中 ElementSplitsplit 在类中 Div<Img>sHeight - 切分高度public String elementType()
关联绘制器:ImgRender
elementType 在类中 Div<Img>Copyright © 2024. All rights reserved.