com.itextpdf.text.Image.setWidthPercentage()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(208)

本文整理了Java中com.itextpdf.text.Image.setWidthPercentage()方法的一些代码示例,展示了Image.setWidthPercentage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Image.setWidthPercentage()方法的具体详情如下:
包路径:com.itextpdf.text.Image
类名称:Image
方法名:setWidthPercentage

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;

相关文章

微信公众号

最新文章

更多