fsImage.scale(cssWidth, cssHeight);
private void scaleBackgroundImage(CssContext c, CalculatedStyle style, Rectangle backgroundContainer, FSImage image) { BackgroundSize backgroundSize = style.getBackgroundSize(); if (! backgroundSize.isBothAuto()) { if (backgroundSize.isCover() || backgroundSize.isContain()) { int testHeight = (int)((double)image.getHeight() * backgroundContainer.width / image.getWidth()); if (backgroundSize.isContain()) { if (testHeight > backgroundContainer.height) { image.scale(-1, backgroundContainer.height); } else { image.scale(backgroundContainer.width, -1); } } else if (backgroundSize.isCover()) { if (testHeight > backgroundContainer.height) { image.scale(backgroundContainer.width, -1); } else { image.scale(-1, backgroundContainer.height); } } } else { int scaledWidth = calcBackgroundSizeLength(c, style, backgroundSize.getWidth(), backgroundContainer.width); int scaledHeight = calcBackgroundSizeLength(c, style, backgroundSize.getHeight(), backgroundContainer.height); image.scale(scaledWidth, scaledHeight); } } }
public int getIntrinsicWidth() { return (int)_image.getWidth(); }
public int getIntrinsicHeight() { return (int)_image.getHeight(); }
private MarkerData.ImageMarker makeImageMarker( LayoutContext c, StrutMetrics structMetrics, String image) { FSImage img = null; if (! image.equals("none")) { img = c.getUac().getImageResource(image).getImage(); if (img != null) { StrutMetrics strutMetrics = structMetrics; if (img.getHeight() > strutMetrics.getAscent()) { img.scale(-1, (int) strutMetrics.getAscent()); } MarkerData.ImageMarker result = new MarkerData.ImageMarker(); result.setImage(img); result.setLayoutWidth(img.getWidth() * 2); return result; } } return null; }
public int getIntrinsicWidth() { return (int)_image.getWidth(); }
public int getIntrinsicHeight() { return (int)_image.getHeight(); }
public void drawImage(FSImage fsImage, int x, int y) { if (fsImage instanceof PDFAsImage) { drawPDFAsImage((PDFAsImage) fsImage, x, y); } else { Image image = ((ITextFSImage) fsImage).getImage(); if (fsImage.getHeight() <= 0 || fsImage.getWidth() <= 0) { return; } AffineTransform at = AffineTransform.getTranslateInstance(x, y); at.translate(0, fsImage.getHeight()); at.scale(fsImage.getWidth(), fsImage.getHeight()); AffineTransform inverse = normalizeMatrix(_transform); AffineTransform flipper = AffineTransform.getScaleInstance(1, -1); inverse.concatenate(at); inverse.concatenate(flipper); double[] mx = new double[6]; inverse.getMatrix(mx); try { _currentPage.addImage(image, (float) mx[0], (float) mx[1], (float) mx[2], (float) mx[3], (float) mx[4], (float) mx[5]); } catch (DocumentException e) { throw new XRRuntimeException(e.getMessage(), e); } } }
private MarkerData.ImageMarker makeImageMarker( LayoutContext c, StrutMetrics structMetrics, String image) { FSImage img = null; if (! image.equals("none")) { img = c.getUac().getImageResource(image).getImage(); if (img != null) { StrutMetrics strutMetrics = structMetrics; if (img.getHeight() > strutMetrics.getAscent()) { img.scale(-1, (int) strutMetrics.getAscent()); } MarkerData.ImageMarker result = new MarkerData.ImageMarker(); result.setImage(img); result.setLayoutWidth(img.getWidth() * 2); return result; } } return null; }
if (fsImage != null) { if ((cssWidth != -1) || (cssHeight != -1)) { fsImage.scale(cssWidth, cssHeight);
public int getIntrinsicWidth() { return (int)_image.getWidth(); }
public int getIntrinsicHeight() { return (int)_image.getHeight(); }
public void drawImage(FSImage fsImage, int x, int y) { if (fsImage instanceof PDFAsImage) { drawPDFAsImage((PDFAsImage) fsImage, x, y); } else { Image image = ((ITextFSImage) fsImage).getImage(); if (fsImage.getHeight() <= 0 || fsImage.getWidth() <= 0) { return; } AffineTransform at = AffineTransform.getTranslateInstance(x, y); at.translate(0, fsImage.getHeight()); at.scale(fsImage.getWidth(), fsImage.getHeight()); AffineTransform inverse = normalizeMatrix(_transform); AffineTransform flipper = AffineTransform.getScaleInstance(1, -1); inverse.concatenate(at); inverse.concatenate(flipper); double[] mx = new double[6]; inverse.getMatrix(mx); try { _currentPage.addImage(image, (float) mx[0], (float) mx[1], (float) mx[2], (float) mx[3], (float) mx[4], (float) mx[5]); } catch (DocumentException e) { throw new XRRuntimeException(e.getMessage(), e); } } }
if (fsImage != null) { if (cssWidth != -1 || cssHeight != -1) { fsImage.scale(cssWidth, cssHeight);
public int getIntrinsicWidth() { return (int)_image.getWidth(); }
public int getIntrinsicHeight() { return (int)_image.getHeight(); }
public void drawImage(FSImage fsImage, int x, int y) { if (fsImage instanceof PDFAsImage) { drawPDFAsImage((PDFAsImage) fsImage, x, y); } else { Image image = ((ITextFSImage) fsImage).getImage(); if (fsImage.getHeight() <= 0 || fsImage.getWidth() <= 0) { return; } AffineTransform at = AffineTransform.getTranslateInstance(x, y); at.translate(0, fsImage.getHeight()); at.scale(fsImage.getWidth(), fsImage.getHeight()); AffineTransform inverse = normalizeMatrix(_transform); AffineTransform flipper = AffineTransform.getScaleInstance(1, -1); inverse.concatenate(at); inverse.concatenate(flipper); double[] mx = new double[6]; inverse.getMatrix(mx); try { _currentPage.addImage(image, (float) mx[0], (float) mx[1], (float) mx[2], (float) mx[3], (float) mx[4], (float) mx[5]); } catch (DocumentException e) { throw new XRRuntimeException(e.getMessage(), e); } } }
if (fsImage != null) { if (cssWidth != -1 || cssHeight != -1) { fsImage.scale(cssWidth, cssHeight);