/** * Concatenates the affine transformation matrix to the current matrix * in the content stream managed by this Canvas. * See also {@link #concatMatrix(double, double, double, double, double, double)} * * @return current canvas */ public PdfCanvas concatMatrix(AffineTransform transform) { float[] matrix = new float[6]; transform.getMatrix(matrix); return concatMatrix(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); }
/** * Replaces the text matrix. Contrast with {@link PdfCanvas#concatMatrix} * @param transform new textmatrix as transformation * @return current canvas * */ public PdfCanvas setTextMatrix(AffineTransform transform) { float[] matrix = new float[6]; transform.getMatrix(matrix); return setTextMatrix(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); }
private void getMatrix(AffineTransform t, float imageItselfScaledWidth, float imageItselfScaledHeight) { t.getMatrix(matrix); PdfXObject xObject = ((Image) (getModelElement())).getXObject(); if (xObject instanceof PdfImageXObject) { matrix[0] *= imageItselfScaledWidth; matrix[1] *= imageItselfScaledWidth; matrix[2] *= imageItselfScaledHeight; matrix[3] *= imageItselfScaledHeight; } }
private void getMatrix(AffineTransform t, float imageItselfScaledWidth, float imageItselfScaledHeight) { t.getMatrix(matrix); PdfXObject xObject = ((Image) (getModelElement())).getXObject(); if (xObject instanceof PdfImageXObject) { matrix[0] *= imageItselfScaledWidth; matrix[1] *= imageItselfScaledWidth; matrix[2] *= imageItselfScaledHeight; matrix[3] *= imageItselfScaledHeight; } }
private void translateImage(float xDistance, float yDistance, AffineTransform t) { t.translate(xDistance, yDistance); t.getMatrix(matrix); if (fixedXPosition != null) { fixedXPosition += (float) t.getTranslateX(); } if (fixedYPosition != null) { fixedYPosition += (float) t.getTranslateY(); } }
private void translateImage(float xDistance, float yDistance, AffineTransform t) { t.translate(xDistance, yDistance); t.getMatrix(matrix); if (fixedXPosition != null) { fixedXPosition += (float) t.getTranslateX(); } if (fixedYPosition != null) { fixedYPosition += (float) t.getTranslateY(); } }
private void applyConcatMatrix(DrawContext drawContext, Float angle) { AffineTransform rotationTransform = AffineTransform.getRotateInstance((float) angle); Rectangle rect = getBorderAreaBBox(); List<Point> rotatedPoints = transformPoints(rectangleToPointsList(rect), rotationTransform); float[] shift = calculateShiftToPositionBBoxOfPointsAt(rect.getX(), rect.getY() + rect.getHeight(), rotatedPoints); double[] matrix = new double[6]; rotationTransform.getMatrix(matrix); drawContext.getCanvas().concatMatrix(matrix[0], matrix[1], matrix[2], matrix[3], shift[0], shift[1]); }
private void applyConcatMatrix(DrawContext drawContext, Float angle) { AffineTransform rotationTransform = AffineTransform.getRotateInstance((float) angle); Rectangle rect = getBorderAreaBBox(); List<Point> rotatedPoints = transformPoints(rectangleToPointsList(rect), rotationTransform); float[] shift = calculateShiftToPositionBBoxOfPointsAt(rect.getX(), rect.getY() + rect.getHeight(), rotatedPoints); double[] matrix = new double[6]; rotationTransform.getMatrix(matrix); drawContext.getCanvas().concatMatrix(matrix[0], matrix[1], matrix[2], matrix[3], shift[0], shift[1]); }
at.getMatrix(m); canvas.addXObject(xObject, m[0], m[1], m[2], m[3], m[4], m[5]);
at.getMatrix(m); canvas.addXObject(xObject, m[0], m[1], m[2], m[3], m[4], m[5]);