本文整理了Java中com.itextpdf.text.Image.setWidthPercentage()
方法的一些代码示例,展示了Image.setWidthPercentage()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Image.setWidthPercentage()
方法的具体详情如下:
包路径:com.itextpdf.text.Image
类名称:Image
方法名:setWidthPercentage
[英]Setter for property widthPercentage.
[中]属性宽度百分比的设置器。
代码示例来源:origin: com.itextpdf/itextg
/**
* Scale the image to an absolute height.
*
* @param newHeight
* the new height
*/
public void scaleAbsoluteHeight(final float newHeight) {
plainHeight = newHeight;
float[] matrix = matrix();
scaledWidth = matrix[DX] - matrix[CX];
scaledHeight = matrix[DY] - matrix[CY];
setWidthPercentage(0);
}
代码示例来源:origin: com.itextpdf/itextpdf
/**
* Scale the image to an absolute width.
*
* @param newWidth
* the new width
*/
public void scaleAbsoluteWidth(final float newWidth) {
plainWidth = newWidth;
float[] matrix = matrix();
scaledWidth = matrix[DX] - matrix[CX];
scaledHeight = matrix[DY] - matrix[CY];
setWidthPercentage(0);
}
代码示例来源:origin: com.itextpdf/itextpdf
/**
* Scale the image to an absolute height.
*
* @param newHeight
* the new height
*/
public void scaleAbsoluteHeight(final float newHeight) {
plainHeight = newHeight;
float[] matrix = matrix();
scaledWidth = matrix[DX] - matrix[CX];
scaledHeight = matrix[DY] - matrix[CY];
setWidthPercentage(0);
}
代码示例来源:origin: com.itextpdf/itextg
/**
* Scale the image to an absolute width.
*
* @param newWidth
* the new width
*/
public void scaleAbsoluteWidth(final float newWidth) {
plainWidth = newWidth;
float[] matrix = matrix();
scaledWidth = matrix[DX] - matrix[CX];
scaledHeight = matrix[DY] - matrix[CY];
setWidthPercentage(0);
}
代码示例来源:origin: com.itextpdf/itextpdf
/**
* Scale the image to an absolute width and an absolute height.
*
* @param newWidth
* the new width
* @param newHeight
* the new height
*/
public void scaleAbsolute(final float newWidth, final float newHeight) {
plainWidth = newWidth;
plainHeight = newHeight;
float[] matrix = matrix();
scaledWidth = matrix[DX] - matrix[CX];
scaledHeight = matrix[DY] - matrix[CY];
setWidthPercentage(0);
}
代码示例来源:origin: com.itextpdf/itextg
/**
* Scale the image to an absolute width and an absolute height.
*
* @param newWidth
* the new width
* @param newHeight
* the new height
*/
public void scaleAbsolute(final float newWidth, final float newHeight) {
plainWidth = newWidth;
plainHeight = newHeight;
float[] matrix = matrix();
scaledWidth = matrix[DX] - matrix[CX];
scaledHeight = matrix[DY] - matrix[CY];
setWidthPercentage(0);
}
代码示例来源:origin: com.itextpdf/itextg
/**
* Scale the width and height of an image to a certain percentage.
*
* @param percentX
* the scaling percentage of the width
* @param percentY
* the scaling percentage of the height
*/
public void scalePercent(final float percentX, final float percentY) {
plainWidth = getWidth() * percentX / 100f;
plainHeight = getHeight() * percentY / 100f;
float[] matrix = matrix();
scaledWidth = matrix[DX] - matrix[CX];
scaledHeight = matrix[DY] - matrix[CY];
setWidthPercentage(0);
}
代码示例来源:origin: com.itextpdf/itextpdf
/**
* Scale the width and height of an image to a certain percentage.
*
* @param percentX
* the scaling percentage of the width
* @param percentY
* the scaling percentage of the height
*/
public void scalePercent(final float percentX, final float percentY) {
plainWidth = getWidth() * percentX / 100f;
plainHeight = getHeight() * percentY / 100f;
float[] matrix = matrix();
scaledWidth = matrix[DX] - matrix[CX];
scaledHeight = matrix[DY] - matrix[CY];
setWidthPercentage(0);
}
代码示例来源:origin: com.itextpdf/itextpdf
/**
* Scales the image so that it fits a certain width and height.
*
* @param fitWidth
* the width to fit
* @param fitHeight
* the height to fit
*/
public void scaleToFit(final float fitWidth, final float fitHeight) {
scalePercent(100);
float percentX = fitWidth * 100 / getScaledWidth();
float percentY = fitHeight * 100 / getScaledHeight();
scalePercent(percentX < percentY ? percentX : percentY);
setWidthPercentage(0);
}
代码示例来源:origin: com.itextpdf/itextg
/**
* Scales the image so that it fits a certain width and height.
*
* @param fitWidth
* the width to fit
* @param fitHeight
* the height to fit
*/
public void scaleToFit(final float fitWidth, final float fitHeight) {
scalePercent(100);
float percentX = fitWidth * 100 / getScaledWidth();
float percentY = fitHeight * 100 / getScaledHeight();
scalePercent(percentX < percentY ? percentX : percentY);
setWidthPercentage(0);
}
代码示例来源:origin: com.itextpdf/itextg
if (after != null)
img.setSpacingAfter(Float.parseFloat(after));
img.setWidthPercentage(0);
return img;
代码示例来源:origin: com.itextpdf/itextpdf
if (after != null)
img.setSpacingAfter(Float.parseFloat(after));
img.setWidthPercentage(0);
return img;
内容来源于网络,如有侵权,请联系作者删除!