public int getIntrinsicWidth() { return (int)_image.getWidth(); }
public int getIntrinsicWidth() { return (int)_image.getWidth(); }
public int getIntrinsicWidth() { return (int)_image.getWidth(); }
public int getIntrinsicWidth() { return (int)_image.getWidth(); }
public int getIntrinsicWidth() { return (int)_image.getWidth(); }
private void paintHorizontalBand(FSImage image, int left, int top, int right) { int width = image.getWidth(); for (int x = left; x < right; x+= width) { drawImage(image, x, top); } }
private void paintHorizontalBand(FSImage image, int left, int top, int right) { int width = image.getWidth(); for (int x = left; x < right; x+= width) { drawImage(image, x, top); } }
private void paintTiles(FSImage image, int left, int top, int right, int bottom) { int width = image.getWidth(); int height = image.getHeight(); for (int x = left; x < right; x+= width) { for (int y = top; y < bottom; y+= height) { drawImage(image, x, y); } } }
private void paintTiles(FSImage image, int left, int top, int right, int bottom) { int width = image.getWidth(); int height = image.getHeight(); for (int x = left; x < right; x+= width) { for (int y = top; y < bottom; y+= height) { drawImage(image, x, y); } } }
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); } } }
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); } } }
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); } } }
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; }
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 void drawImage(FSImage image, int x, int y) { Image img = ((SWTFSImage) image).getImage(); if (img == null) { int width = image.getWidth(); int height = image.getHeight(); Color oldBG = _gc.getBackground(); Color oldFG = _gc.getForeground(); _gc.setBackground(_gc.getDevice().getSystemColor(SWT.COLOR_WHITE)); _gc.setForeground(_gc.getDevice().getSystemColor(SWT.COLOR_BLACK)); _gc.fillRectangle(x, y, width, height); _gc.drawRectangle(x, y, width, height); _gc.drawLine(x, y, x + width - 1, y + height - 1); _gc.drawLine(x, y + height - 1, x + width - 1, y); _gc.setBackground(oldBG); _gc.setForeground(oldFG); } else { Rectangle bounds = img.getBounds(); _gc.drawImage(img, 0, 0, bounds.width, bounds.height, x, y, image .getWidth(), image.getHeight()); } }
private static void drawImage(RenderingContext c, BlockBox box, MarkerData markerData) { FSImage img = null; MarkerData.ImageMarker marker = markerData.getImageMarker(); img = marker.getImage(); if (img != null) { StrutMetrics strutMetrics = box.getMarkerData().getStructMetrics(); int x = getReferenceX(c, box); x += -marker.getLayoutWidth() + (marker.getLayoutWidth() / 2 - img.getWidth() / 2); c.getOutputDevice().drawImage(img, x, (int)(getReferenceBaseline(c, box) - strutMetrics.getAscent() / 2 - img.getHeight() / 2)); } }
private static void drawImage(RenderingContext c, BlockBox box, MarkerData markerData) { FSImage img = null; MarkerData.ImageMarker marker = markerData.getImageMarker(); img = marker.getImage(); if (img != null) { StrutMetrics strutMetrics = box.getMarkerData().getStructMetrics(); int x = getReferenceX(c, box); // FIXME: findbugs possible loss of precision, cf. int / (float)2 x += -marker.getLayoutWidth() + (marker.getLayoutWidth() / 2 - img.getWidth() / 2); c.getOutputDevice().drawImage(img, x, (int)(getReferenceBaseline(c, box) - strutMetrics.getAscent() / 2 - img.getHeight() / 2)); } }
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); } } }