KickJava   Java API By Example, From Geeks To Geeks.

Java > Java SE, EE, ME > java > awt > image > BufferedImage

java.awt.image
Class BufferedImage

java.lang.Object
  extended by java.awt.Image
      extended by java.awt.image.BufferedImage
All Implemented Interfaces:
RenderedImage, WritableRenderedImage, Transparency
See Also:
Top Examples, Source Code, SampleModel, ColorModel, Raster, WritableRaster

public void addTileObserver(TileObserver to)
See Also:
WritableRenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BufferedImage(int width,
                     int height,
                     int imageType)
See Also:
TYPE_USHORT_555_RGB, TYPE_USHORT_565_RGB, TYPE_BYTE_INDEXED, TYPE_BYTE_BINARY, TYPE_USHORT_GRAY, TYPE_BYTE_GRAY, TYPE_4BYTE_ABGR_PRE, TYPE_4BYTE_ABGR, TYPE_3BYTE_BGR, TYPE_INT_BGR, TYPE_INT_ARGB_PRE, TYPE_INT_ARGB, TYPE_INT_RGB, ColorSpace
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[96]Read in an image from a file
By Anonymous on 2005/04/27 07:23:12  Rate
//To read in an image from a file. 
  
  
 File f = new File ( "c:\imagefilename.jpg" ) ; 
 BufferedImage img = ImageIO.read ( f ) ; 
  
  
 


public BufferedImage(int width,
                     int height,
                     int imageType,
                     IndexColorModel cm)
See Also:
TYPE_BYTE_INDEXED, TYPE_BYTE_BINARY, IllegalArgumentException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BufferedImage(ColorModel cm,
                     WritableRaster raster,
                     boolean isRasterPremultiplied,
                     Hashtable<?,?> properties)
See Also:
Raster, RasterFormatException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void coerceData(boolean isAlphaPremultiplied)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public WritableRaster copyData(WritableRaster outRaster)
See Also:
RenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[534]Make a new BufferedImage containing a part of an other image
By andersen (haugeto at idi { dot } ntnu { dot } no) on 2003/11/18 16:04:25  Rate
// how to make a new BufferedImage containing a part of an other image. 
  
  
 // fill originalImage with something: 
 BufferedImage originalImage = ... 
  
  
 BufferedImage subImage, tempImage; 
 // get reference to the sub-image you want: 
 tempImage = originalImage.getSubimage ( x, y, width, height ) ; 
 // copy the contents of this sub-image: 
 WritableRaster wr = tempImage.copyData ( null ) ; 
 // create new image.. 
 subImage = new BufferedImage ( width, height, BufferedImage.TYPE_INT_ARGB ) ; 
 // .. and fill it with the contents of the extracted sub-image:         
 subImage.setData ( wr ) ; 
 // voila. your copy is now in subImage. 
  
  
 // is there a better way to do this??


public Graphics2D createGraphics()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void flush()
See Also:
Image
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public WritableRaster getAlphaRaster()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public ImageCapabilities getCapabilities(GraphicsConfiguration gc)
See Also:
Image
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public ColorModel getColorModel()
See Also:
RenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Raster getData()
See Also:
setData(Raster), RenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Raster getData(Rectangle rect)
See Also:
setData(Raster), RenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Graphics getGraphics()
See Also:
Component.createImage(int, int), Image, createGraphics, Graphics2D
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getHeight()
See Also:
RenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getHeight(ImageObserver observer)
See Also:
Image.getWidth(java.awt.image.ImageObserver)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getMinTileX()
See Also:
RenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getMinTileY()
See Also:
RenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getMinX()
See Also:
RenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getMinY()
See Also:
RenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getNumXTiles()
See Also:
RenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getNumYTiles()
See Also:
RenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Object getProperty(String name)
See Also:
Image.UndefinedProperty, RenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Object getProperty(String name,
                          ImageObserver observer)
See Also:
Image.UndefinedProperty
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public String[] getPropertyNames()
See Also:
RenderedImage, getProperty(String)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public WritableRaster getRaster()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getRGB(int x,
                  int y)
See Also:
setRGB(int, int, int, int, int[], int, int), setRGB(int, int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int[] getRGB(int startX,
                    int startY,
                    int w,
                    int h,
                    int[] rgbArray,
                    int offset,
                    int scansize)
See Also:
setRGB(int, int, int, int, int[], int, int), setRGB(int, int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public SampleModel getSampleModel()
See Also:
RenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public ImageProducer getSource()
See Also:
Image
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Vector<RenderedImage> getSources()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BufferedImage getSubimage(int x,
                                 int y,
                                 int w,
                                 int h)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Raster getTile(int tileX,
                      int tileY)
See Also:
RenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getTileGridXOffset()
See Also:
RenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getTileGridYOffset()
See Also:
RenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getTileHeight()
See Also:
RenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getTileWidth()
See Also:
RenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getTransparency()
See Also:
Transparency.TRANSLUCENT, Transparency.BITMASK, Transparency.OPAQUE
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getType()
See Also:
TYPE_CUSTOM, TYPE_USHORT_555_RGB, TYPE_USHORT_565_RGB, TYPE_USHORT_GRAY, TYPE_BYTE_INDEXED, TYPE_BYTE_BINARY, TYPE_BYTE_GRAY, TYPE_4BYTE_ABGR_PRE, TYPE_4BYTE_ABGR, TYPE_3BYTE_BGR, TYPE_INT_BGR, TYPE_INT_ARGB_PRE, TYPE_INT_ARGB, TYPE_INT_RGB
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getWidth()
See Also:
RenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getWidth(ImageObserver observer)
See Also:
Image.getHeight(java.awt.image.ImageObserver)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public WritableRaster getWritableTile(int tileX,
                                      int tileY)
See Also:
WritableRenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Point[] getWritableTileIndices()
See Also:
WritableRenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public boolean hasTileWriters()
See Also:
WritableRenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public boolean isAlphaPremultiplied()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public boolean isTileWritable(int tileX,
                              int tileY)
See Also:
WritableRenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void releaseWritableTile(int tileX,
                                int tileY)
See Also:
WritableRenderedImage, getWritableTile(int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void removeTileObserver(TileObserver to)
See Also:
WritableRenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setData(Raster r)
See Also:
getData(Rectangle), getData(), WritableRenderedImage
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setRGB(int x,
                   int y,
                   int rgb)
See Also:
getRGB(int, int, int, int, int[], int, int), getRGB(int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setRGB(int startX,
                   int startY,
                   int w,
                   int h,
                   int[] rgbArray,
                   int offset,
                   int scansize)
See Also:
getRGB(int, int, int, int, int[], int, int), getRGB(int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public String toString()
See Also:
Object
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int TYPE_3BYTE_BGR
See Also:
AlphaComposite
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int TYPE_4BYTE_ABGR
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int TYPE_4BYTE_ABGR_PRE
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int TYPE_BYTE_BINARY
See Also:
IndexColorModel
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int TYPE_BYTE_GRAY
See Also:
AlphaComposite, ColorSpace
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int TYPE_BYTE_INDEXED
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int TYPE_CUSTOM
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int TYPE_INT_ARGB
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int TYPE_INT_ARGB_PRE
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int TYPE_INT_BGR
See Also:
AlphaComposite, DirectColorModel
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int TYPE_INT_RGB
See Also:
AlphaComposite, DirectColorModel
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int TYPE_USHORT_555_RGB
See Also:
AlphaComposite
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int TYPE_USHORT_565_RGB
See Also:
AlphaComposite
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int TYPE_USHORT_GRAY
See Also:
AlphaComposite
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  

Popular Tags