/** Return the image associated with a bitmap in a Metafile. * 24 bits and 8 bits bitmaps are handled. * @param bit the bitmap byte array * @param width the bitmap assumed width * @param height the bitmap assumed height * @return the Image associated with the bitmap (null if the dimensions detected in the * header are not consistent with the assumed dimensions) */ protected BufferedImage getImage(byte[] bit, int width, int height) { // get the header of the bitmap, first the width and height int _width = (((int)bit[7] & 0x00ff) << 24) | (((int)bit[6] & 0x00ff) << 16) | (((int)bit[5] & 0x00ff) << 8) | (int)bit[4] & 0x00ff; int _height = (((int)bit[11] & 0x00ff) << 24) | (((int)bit[10] & 0x00ff) << 16) | (((int)bit[9] & 0x00ff) <<8) | (int)bit[8] & 0x00ff; // if width and height of the bitmap are different from advertised, we abort if ((width != _width) || (height != _height)) return null; return getImage(bit); }
/** Create an AttributedCharacterIterator with the current definition of the WMF Font, and * the input String. */ protected AttributedCharacterIterator getCharacterIterator(Graphics2D g2d, String sr, WMFFont wmffont) { return getAttributedString(g2d, sr, wmffont).getIterator(); }
/** Create an AttributedCharacterIterator with the current definition of the WMF Font, and * the input String. */ protected AttributedCharacterIterator getCharacterIterator(Graphics2D g2d, String sr, WMFFont wmffont) { return getAttributedString(g2d, sr, wmffont).getIterator(); }
/** Create an AttributedCharacterIterator with the current definition of the WMF Font, and * the input String. */ protected AttributedCharacterIterator getCharacterIterator(Graphics2D g2d, String sr, WMFFont wmffont, int align) { AttributedString ats = getAttributedString(g2d, sr, wmffont); return ats.getIterator(); }
/** Return the image associated with a bitmap in a Metafile. * 24 bits and 8 bits bitmaps are handled. * @param bit the bitmap byte array * @param width the bitmap assumed width * @param height the bitmap assumed height * @return the Image associated with the bitmap (null if the dimensions detected in the * header are not consistent with the assumed dimensions) */ protected BufferedImage getImage(byte[] bit, int width, int height) { // get the header of the bitmap, first the width and height int _width = ((bit[7] & 0x00ff) << 24) | ((bit[6] & 0x00ff) << 16) | ((bit[5] & 0x00ff) << 8) | bit[4] & 0x00ff; int _height = ((bit[11] & 0x00ff) << 24) | ((bit[10] & 0x00ff) << 16) | ((bit[9] & 0x00ff) <<8) | bit[8] & 0x00ff; // if width and height of the bitmap are different from advertised, we abort if ((width != _width) || (height != _height)) return null; return getImage(bit); }
/** Create an AttributedCharacterIterator with the current definition of the WMF Font, and * the input String. */ protected AttributedCharacterIterator getCharacterIterator(Graphics2D g2d, String sr, WMFFont wmffont, int align) { AttributedString ats = getAttributedString(g2d, sr, wmffont); return ats.getIterator(); }