/** * Accessor for the image dimensions * * @return the number of rows which this image spans */ public double getHeight() { return super.getHeight(); }
/** * Accessor for the anchor properties */ public ImageAnchorProperties getImageAnchor() { return super.getImageAnchor(); } }
/** * Accessor for the image data * * @return the image data */ public byte[] getImageData() { return super.getImageData(); }
maxShapeId++; drawings.add(drawing); drawing.setDrawingGroup(this); drawing.setObjectId(maxObjectId, numBlips + 1, maxShapeId); numBlips++; imageFiles.put(drawing.getImageFilePath(), drawing); refImage.setReferenceCount(refImage.getReferenceCount() + 1); drawing.setDrawingGroup(this); drawing.setObjectId(refImage.getObjectId(), refImage.getBlipId(), refImage.getShapeId());
/** * Constructor * * @param d the drawing * @exception IOException */ public BlipStoreEntry(Drawing d) throws IOException { super(EscherRecordType.BSE); type = BlipType.PNG; setVersion(2); setInstance(type.getValue()); byte[] imageData = d.getImageBytes(); imageDataLength = imageData.length; data = new byte[imageDataLength + IMAGE_DATA_OFFSET]; System.arraycopy(imageData, 0, data, IMAGE_DATA_OFFSET, imageDataLength); referenceCount = d.getReferenceCount(); write = true; }
private PNGReader getPngReader() { if (pngReader != null) { return pngReader; } byte[] imdata = null; if (origin == Origin.READ || origin == Origin.READ_WRITE) { imdata = getImageData(); } else { try { imdata = getImageBytes(); } catch (IOException e) { logger.warn("Could not read image file"); imdata = new byte[0]; } } pngReader = new PNGReader(imdata); pngReader.read(); return pngReader; }
/** * Accessor for the image file * * @return the file which the image references */ public File getImageFile() { return super.getImageFile(); }
/** * Get the height of this image as rendered within Excel * * @param unit the unit of measurement * @return the height of the image within Excel */ public double getHeight(LengthUnit unit) { double heightInPoints = getHeightInPoints(); return heightInPoints * LengthConverter.getConversionFactor (LengthUnit.POINTS, unit); }
Drawing drawing = new Drawing(msoRecord, objRecord, drawingData,
maxShapeId++; drawings.add(drawing); drawing.setDrawingGroup(this); drawing.setObjectId(maxObjectId, numBlips + 1, maxShapeId); numBlips++; imageFiles.put(drawing.getImageFilePath(), drawing); refImage.setReferenceCount(refImage.getReferenceCount() + 1); drawing.setDrawingGroup(this); drawing.setObjectId(refImage.getObjectId(), refImage.getBlipId(), refImage.getShapeId());
/** * Constructor * * @param d the drawing * @exception IOException */ public BlipStoreEntry(Drawing d) throws IOException { super(EscherRecordType.BSE); type = BlipType.PNG; setVersion(2); setInstance(type.getValue()); byte[] imageData = d.getImageBytes(); imageDataLength = imageData.length; data = new byte[imageDataLength + IMAGE_DATA_OFFSET]; System.arraycopy(imageData, 0, data, IMAGE_DATA_OFFSET, imageDataLength); referenceCount = d.getReferenceCount(); write = true; }
private PNGReader getPngReader() { if (pngReader != null) { return pngReader; } byte[] imdata = null; if (origin == Origin.READ || origin == Origin.READ_WRITE) { imdata = getImageData(); } else { try { imdata = getImageBytes(); } catch (IOException e) { logger.warn("Could not read image file"); imdata = new byte[0]; } } pngReader = new PNGReader(imdata); pngReader.read(); return pngReader; }
/** * Accessor for the image file * * @return the file which the image references */ public File getImageFile() { return super.getImageFile(); }
/** * Get the height of this image as rendered within Excel * * @param unit the unit of measurement * @return the height of the image within Excel */ public double getHeight(LengthUnit unit) { double heightInPoints = getHeightInPoints(); return heightInPoints * LengthConverter.getConversionFactor (LengthUnit.POINTS, unit); }
Drawing drawing = new Drawing(msoRecord, objRecord, drawingData,
/** * Accessor for the image data * * @return the image data */ public byte[] getImageData() { return super.getImageData(); }
/** * Accessor for the image dimensions * * @return the number of rows which this image spans */ public double getHeight() { return super.getHeight(); }
/** * Accessor for the anchor properties */ public ImageAnchorProperties getImageAnchor() { return super.getImageAnchor(); } }
/** * Accessor for the image data * * @return the image data */ public byte[] getImageBytes() throws IOException { if (origin == Origin.READ || origin == Origin.READ_WRITE) { return getImageData(); } Assert.verify(origin == Origin.WRITE); if (imageFile == null) { Assert.verify(imageData != null); return imageData; } byte[] data = new byte[(int) imageFile.length()]; FileInputStream fis = new FileInputStream(imageFile); fis.read(data, 0, data.length); fis.close(); return data; }
/** * Accessor for the image data * * @return the image data */ public byte[] getImageBytes() throws IOException { if (origin == Origin.READ || origin == Origin.READ_WRITE) { return getImageData(); } Assert.verify(origin == Origin.WRITE); if (imageFile == null) { Assert.verify(imageData != null); return imageData; } byte[] data = new byte[(int) imageFile.length()]; FileInputStream fis = new FileInputStream(imageFile); fis.read(data, 0, data.length); fis.close(); return data; }