Here you can find the source of updateImageSpecifications( BufferedImage bufferedImage)
Parameter | Description |
---|---|
bufferedImage | The image for which to perform a read-, write- or erase-operation. |
Parameter | Description |
---|---|
Exception | Unspecified Exception in case something goes wrong. |
private static void updateImageSpecifications( BufferedImage bufferedImage) throws Exception
//package com.java2s; //License from project: Open Source License import java.awt.image.BufferedImage; import java.awt.image.ColorModel; import java.awt.image.WritableRaster; public class Main { private static BufferedImage image; private static ColorModel imageColorModel; private static WritableRaster imageRaster; private static int imageHeight; private static int imageWidth; /**//from w w w.j a v a 2 s .c o m * Updated the local (static) variables holding the image, the color-model of the image, the raster of the * image, and the height and width of the image-raster. * * @param bufferedImage The image for which to perform a read-, write- or erase-operation. * * @throws Exception Unspecified Exception in case something goes wrong. */ private static void updateImageSpecifications( BufferedImage bufferedImage) throws Exception { image = bufferedImage; imageColorModel = image.getColorModel(); imageRaster = image.getRaster(); imageHeight = imageRaster.getHeight(); imageWidth = imageRaster.getWidth(); } }