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

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

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

Image.matrix介绍

[英]Returns the transformation matrix of the image.
[中]返回图像的变换矩阵。

代码示例

代码示例来源:origin: com.itextpdf/itextpdf

/**
 * Returns the transformation matrix of the image.
 *
 * @return an array [AX, AY, BX, BY, CX, CY, DX, DY]
 */
public float[] matrix() {
  return matrix(1);
}

代码示例来源:origin: com.itextpdf/itextg

/**
 * Returns the transformation matrix of the image.
 *
 * @return an array [AX, AY, BX, BY, CX, CY, DX, DY]
 */
public float[] matrix() {
  return matrix(1);
}

代码示例来源:origin: com.itextpdf/itextpdf

/**
 * Sets the rotation of the image in radians.
 *
 * @param r
 *            rotation in radians
 */
public void setRotation(final float r) {
  double d = 2.0 * Math.PI;
  rotationRadians = (float) ((r + initialRotation) % d);
  if (rotationRadians < 0) {
    rotationRadians += d;
  }
  float[] matrix = matrix();
  scaledWidth = matrix[DX] - matrix[CX];
  scaledHeight = matrix[DY] - matrix[CY];
}

代码示例来源:origin: com.itextpdf/itextg

/**
 * Sets the rotation of the image in radians.
 *
 * @param r
 *            rotation in radians
 */
public void setRotation(final float r) {
  double d = 2.0 * Math.PI;
  rotationRadians = (float) ((r + initialRotation) % d);
  if (rotationRadians < 0) {
    rotationRadians += d;
  }
  float[] matrix = matrix();
  scaledWidth = matrix[DX] - matrix[CX];
  scaledHeight = matrix[DY] - matrix[CY];
}

代码示例来源: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/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/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 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/itextg

/**
 * Adds an <CODE>Image</CODE> to the page. The <CODE>Image</CODE> must have
 * absolute positioning. The image can be placed inline.
 * @param image the <CODE>Image</CODE> object
 * @param inlineImage <CODE>true</CODE> to place this image inline, <CODE>false</CODE> otherwise
 * @throws DocumentException if the <CODE>Image</CODE> does not have absolute positioning
 */
public void addImage(final Image image, final boolean inlineImage) throws DocumentException {
  if (!image.hasAbsoluteY())
    throw new DocumentException(MessageLocalization.getComposedMessage("the.image.must.have.absolute.positioning"));
  float matrix[] = image.matrix();
  matrix[Image.CX] = image.getAbsoluteX() - matrix[Image.CX];
  matrix[Image.CY] = image.getAbsoluteY() - matrix[Image.CY];
  addImage(image, matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], inlineImage);
}

代码示例来源:origin: com.itextpdf/itextpdf

/**
 * Adds an <CODE>Image</CODE> to the page. The <CODE>Image</CODE> must have
 * absolute positioning. The image can be placed inline.
 * @param image the <CODE>Image</CODE> object
 * @param inlineImage <CODE>true</CODE> to place this image inline, <CODE>false</CODE> otherwise
 * @throws DocumentException if the <CODE>Image</CODE> does not have absolute positioning
 */
public void addImage(final Image image, final boolean inlineImage) throws DocumentException {
  if (!image.hasAbsoluteY())
    throw new DocumentException(MessageLocalization.getComposedMessage("the.image.must.have.absolute.positioning"));
  float matrix[] = image.matrix();
  matrix[Image.CX] = image.getAbsoluteX() - matrix[Image.CX];
  matrix[Image.CY] = image.getAbsoluteY() - matrix[Image.CY];
  addImage(image, matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], inlineImage);
}

代码示例来源:origin: ekoz/kbase-doc

float w = Math.min(img.getScaledWidth(), 460);
float h = Math.min(img.getScaledHeight(), 300);
for (float f : img.matrix()) {
  System.out.println(f);

代码示例来源:origin: com.itextpdf/itextg

Image image = chunk.getImage();
width = chunk.getImageWidth();
float matrix[] = image.matrix(chunk.getImageScalePercentage());
matrix[Image.CX] = xMarker + chunk.getImageOffsetX() - matrix[Image.CX];
matrix[Image.CY] = yMarker + chunk.getImageOffsetY() - matrix[Image.CY];

代码示例来源:origin: com.itextpdf/itextpdf

Image image = chunk.getImage();
width = chunk.getImageWidth();
float matrix[] = image.matrix(chunk.getImageScalePercentage());
matrix[Image.CX] = xMarker + chunk.getImageOffsetX() - matrix[Image.CX];
matrix[Image.CY] = yMarker + chunk.getImageOffsetY() - matrix[Image.CY];

代码示例来源:origin: com.itextpdf/itextpdf

float mt[] = image.matrix();
float startPosition = indentLeft() - mt[4];
if ((image.getAlignment() & Image.RIGHT) == Image.RIGHT) startPosition = indentRight() - image.getScaledWidth() - mt[4];

代码示例来源:origin: com.itextpdf/itextg

float mt[] = image.matrix();
float startPosition = indentLeft() - mt[4];
if ((image.getAlignment() & Image.RIGHT) == Image.RIGHT) startPosition = indentRight() - image.getScaledWidth() - mt[4];

相关文章

微信公众号

最新文章

更多