本文整理匯總了Java中com.lowagie.text.Image.setOriginalType方法的典型用法代碼示例。如果您正苦於以下問題:Java Image.setOriginalType方法的具體用法?Java Image.setOriginalType怎麽用?Java Image.setOriginalType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.lowagie.text.Image
的用法示例。
在下文中一共展示了Image.setOriginalType方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getImage
import com.lowagie.text.Image; //導入方法依賴的package包/類
/** Reads a BMP from a stream. The stream is not closed.
* The BMP may not have a header and be considered as a plain DIB.
* @param is the stream
* @param noHeader true to process a plain DIB
* @param size the size of the DIB. Not used for a BMP
* @throws IOException on error
* @return the image
*/
public static Image getImage(InputStream is, boolean noHeader, int size) throws IOException {
BmpImage bmp = new BmpImage(is, noHeader, size);
try {
Image img = bmp.getImage();
img.setDpi((int)(bmp.xPelsPerMeter * 0.0254d + 0.5d), (int)(bmp.yPelsPerMeter * 0.0254d + 0.5d));
img.setOriginalType(Image.ORIGINAL_BMP);
return img;
}
catch (BadElementException be) {
throw new ExceptionConverter(be);
}
}