Java Doc for BufferedImage.java in  » 6.0-JDK-Modules » j2me » java » awt » image » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » java.awt.image 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.awt.Image
      java.awt.image.BufferedImage

All known Subclasses:   java.awt.X11Image,
BufferedImage
public class BufferedImage extends java.awt.Image (Code)
The BufferedImage subclass describes an Image with an accessible buffer of image data. A BufferedImage is comprised of a ColorModel and a Raster of image data. The number and types of bands in the SampleModel of the Raster must match the number and types required by the ColorModel to represent its color and alpha components. All BufferedImage objects have an upper left corner coordinate of (0, 0). Any Raster used to construct a BufferedImage must therefore have minX=0 and minY=0.
See Also:   ColorModel
See Also:   Raster
See Also:   WritableRaster
version:
   10 Feb 1997


Field Summary
final public static  intTYPE_BYTE_BINARY
     Represents an opaque byte-packed binary image.
final public static  intTYPE_BYTE_INDEXED
     Represents an indexed byte image.
final public static  intTYPE_CUSTOM
     Image type is not recognized so it must be a customized image.
final public static  intTYPE_INT_ARGB
     Represents an image with 8-bit RGBA color components packed into integer pixels.
final public static  intTYPE_INT_ARGB_PRE
     Represents an image with 8-bit RGBA color components packed into integer pixels.
final public static  intTYPE_INT_BGR
     Represents an image with 8-bit RGB color components, corresponding to a Windows- or Solaris- style BGR color model, with the colors Blue, Green, and Red packed into integer pixels.
final public static  intTYPE_INT_RGB
     Represents an image with 8-bit RGB color components packed into integer pixels.
final public static  intTYPE_USHORT_555_RGB
     Represents an image with 5-5-5 RGB color components (5-bits red, 5-bits green, 5-bits blue) with no alpha.
final public static  intTYPE_USHORT_565_RGB
     Represents an image with 5-6-5 RGB color components (5-bits red, 6-bits green, 5-bits blue) with no alpha.


Method Summary
public  Graphics2DcreateGraphics()
     Creates a Graphics2D, which can be used to draw into this BufferedImage.
public  voidflush()
     Flushes all resources being used to cache optimization information.
public  ColorModelgetColorModel()
     Returns the ColorModel.
public  java.awt.GraphicsgetGraphics()
     This method returns a Graphics2D , but is here for backwards compatibility.
public  intgetHeight()
     Returns the height of the BufferedImage.
public  intgetHeight(ImageObserver observer)
     Returns the actual height of the image.
public  ObjectgetProperty(String name, ImageObserver observer)
     Returns a property of the image by name.
public  ObjectgetProperty(String name)
     Returns a property of the image by name.
public  String[]getPropertyNames()
     Returns an array of names recognized by BufferedImage.getProperty(String) getProperty(String) or null, if no property names are recognized.
public  intgetRGB(int x, int y)
     Returns an integer pixel in the default RGB color model (TYPE_INT_ARGB) and default sRGB colorspace.
public  int[]getRGB(int startX, int startY, int w, int h, int[] rgbArray, int offset, int scansize)
     Returns an array of integer pixels in the default RGB color model (TYPE_INT_ARGB) and default sRGB color space, from a portion of the image data.
public  ImageProducergetSource()
     Returns the object that produces the pixels for the image.
public  BufferedImagegetSubimage(int x, int y, int w, int h)
     Returns a subimage defined by a specified rectangular region. The returned BufferedImage shares the same data array as the original image. x, y the coordinates of the upper-left corner of thespecified rectangular region
Parameters:
  w - the width of the specified rectangular region
Parameters:
  h - the height of the specified rectangular region a BufferedImage that is the subimage of thisBufferedImage.
public  intgetType()
     Returns the image type.
public  intgetWidth()
     Returns the width of the BufferedImage.
public  intgetWidth(ImageObserver observer)
     Returns the actual width of the image.
public synchronized  voidsetRGB(int x, int y, int rgb)
     Sets a pixel in this BufferedImage to the specified RGB value.
public  voidsetRGB(int startX, int startY, int w, int h, int[] rgbArray, int offset, int scansize)
     Sets an array of integer pixels in the default RGB color model (TYPE_INT_ARGB) and default sRGB color space, into a portion of the image data.
public  StringtoString()
     Returns a String representation of this BufferedImage object and its values.

Field Detail
TYPE_BYTE_BINARY
final public static int TYPE_BYTE_BINARY(Code)
Represents an opaque byte-packed binary image. The image has an IndexColorModel without alpha. When this type is used as the imageType argument to the BufferedImage constructor that takes an imageType argument but no ColorModel argument, an IndexColorModel is created with two colors in the default sRGB ColorSpace: {0, 0, 0} and {255, 255, 255}.



TYPE_BYTE_INDEXED
final public static int TYPE_BYTE_INDEXED(Code)
Represents an indexed byte image. When this type is used as the imageType argument to the BufferedImage constructor that takes an imageType argument but no ColorModel argument, an IndexColorModel is created with a 256-color 6/6/6 color cube palette with the rest of the colors from 216-255 populated by grayscale values in the default sRGB ColorSpace.



TYPE_CUSTOM
final public static int TYPE_CUSTOM(Code)
Image type is not recognized so it must be a customized image. This type is only used as a return value for the getType() method.



TYPE_INT_ARGB
final public static int TYPE_INT_ARGB(Code)
Represents an image with 8-bit RGBA color components packed into integer pixels. The image has a DirectColorModel with alpha. The color data in this image is considered not to be premultiplied with alpha. When this type is used as the imageType argument to a BufferedImage constructor, the created image is consistent with images created in the JDK1.1 and earlier releases.



TYPE_INT_ARGB_PRE
final public static int TYPE_INT_ARGB_PRE(Code)
Represents an image with 8-bit RGBA color components packed into integer pixels. The image has a DirectColorModel with alpha. The color data in this image is considered to be premultiplied with alpha.



TYPE_INT_BGR
final public static int TYPE_INT_BGR(Code)
Represents an image with 8-bit RGB color components, corresponding to a Windows- or Solaris- style BGR color model, with the colors Blue, Green, and Red packed into integer pixels. There is no alpha. The image has a ComponentColorModel .



TYPE_INT_RGB
final public static int TYPE_INT_RGB(Code)
Represents an image with 8-bit RGB color components packed into integer pixels. The image has a DirectColorModel without alpha.



TYPE_USHORT_555_RGB
final public static int TYPE_USHORT_555_RGB(Code)
Represents an image with 5-5-5 RGB color components (5-bits red, 5-bits green, 5-bits blue) with no alpha. This image has a DirectColorModel.



TYPE_USHORT_565_RGB
final public static int TYPE_USHORT_565_RGB(Code)
Represents an image with 5-6-5 RGB color components (5-bits red, 6-bits green, 5-bits blue) with no alpha. This image has a DirectColorModel.





Method Detail
createGraphics
public Graphics2D createGraphics()(Code)
Creates a Graphics2D, which can be used to draw into this BufferedImage. a Graphics2D, used for drawing into thisimage.



flush
public void flush()(Code)
Flushes all resources being used to cache optimization information. The underlying pixel data is unaffected.



getColorModel
public ColorModel getColorModel()(Code)
Returns the ColorModel. the ColorModel of thisBufferedImage.



getGraphics
public java.awt.Graphics getGraphics()(Code)
This method returns a Graphics2D , but is here for backwards compatibility. BufferedImage.createGraphics() createGraphics is more convenient, since it is declared to return a Graphics2D. a Graphics2D, which can be used to draw intothis image.



getHeight
public int getHeight()(Code)
Returns the height of the BufferedImage. the height of this BufferedImage.



getHeight
public int getHeight(ImageObserver observer)(Code)
Returns the actual height of the image. If the height is not known yet then the ImageObserver is notified later and -1 is returned.
Parameters:
  observer - the ImageObserver that receivesinformation about the image the height of the image or -1 if the heightis not yet known.
See Also:   java.awt.Image.getWidth(ImageObserver)
See Also:   ImageObserver



getProperty
public Object getProperty(String name, ImageObserver observer)(Code)
Returns a property of the image by name. Individual property names are defined by the various image formats. If a property is not defined for a particular image, this method returns the UndefinedProperty field. If the properties for this image are not yet known, then this method returns null and the ImageObserver object is notified later. The property name "comment" should be used to store an optional comment that can be presented to the user as a description of the image, its source, or its author.
Parameters:
  name - the property name
Parameters:
  observer - the ImageObserver that receivesnotification regarding image information an Object that is the property referred to by thespecified name or null if theproperties of this image are not yet known.
See Also:   ImageObserver
See Also:   java.awt.Image.UndefinedProperty



getProperty
public Object getProperty(String name)(Code)
Returns a property of the image by name.
Parameters:
  name - the property name an Object that is the property referred to bythe specified name.



getPropertyNames
public String[] getPropertyNames()(Code)
Returns an array of names recognized by BufferedImage.getProperty(String) getProperty(String) or null, if no property names are recognized. a String array containing all of the propertynames that getProperty(String) recognizes;or null if no property names are recognized.



getRGB
public int getRGB(int x, int y)(Code)
Returns an integer pixel in the default RGB color model (TYPE_INT_ARGB) and default sRGB colorspace. Color conversion takes place if this default model does not match the image ColorModel. There are only 8-bits of precision for each color component in the returned data when using this method. x, y the coordinates of the pixel from which to getthe pixel in the default RGB color model and sRGBcolor space an integer pixel in the default RGB color model anddefault sRGB colorspace.



getRGB
public int[] getRGB(int startX, int startY, int w, int h, int[] rgbArray, int offset, int scansize)(Code)
Returns an array of integer pixels in the default RGB color model (TYPE_INT_ARGB) and default sRGB color space, from a portion of the image data. Color conversion takes place if the default model does not match the image ColorModel. There are only 8-bits of precision for each color component in the returned data when using this method. With a specified coordinate (x, y) in the image, the ARGB pixel can be accessed in this way:
 pixel   = rgbArray[offset + (y-startY)*scansize + (x-startX)];
 
startX,  startY the starting coordinates
Parameters:
  w - width of region
Parameters:
  h - height of region
Parameters:
  rgbArray - if not null, the rgb pixels arewritten here
Parameters:
  offset - offset into the rgbArray
Parameters:
  scansize - scanline stride for the rgbArray array of RGB pixels. IllegalArgumentException if an unknowndatatype is specified



getSource
public ImageProducer getSource()(Code)
Returns the object that produces the pixels for the image. the ImageProducer that is used to produce thepixels for this image.
See Also:   ImageProducer



getSubimage
public BufferedImage getSubimage(int x, int y, int w, int h)(Code)
Returns a subimage defined by a specified rectangular region. The returned BufferedImage shares the same data array as the original image. x, y the coordinates of the upper-left corner of thespecified rectangular region
Parameters:
  w - the width of the specified rectangular region
Parameters:
  h - the height of the specified rectangular region a BufferedImage that is the subimage of thisBufferedImage. RasterFormatException if the specifiedarea is not contained within this BufferedImage.



getType
public int getType()(Code)
Returns the image type. If it is not one of the known types, TYPE_CUSTOM is returned. the image type of this BufferedImage.
See Also:   BufferedImage.TYPE_INT_RGB
See Also:   BufferedImage.TYPE_INT_ARGB
See Also:   BufferedImage.TYPE_INT_ARGB_PRE
See Also:   BufferedImage.TYPE_INT_BGR
See Also:   BufferedImage.TYPE_3BYTE_BGR
See Also:   BufferedImage.TYPE_4BYTE_ABGR
See Also:   BufferedImage.TYPE_4BYTE_ABGR_PRE
See Also:   BufferedImage.TYPE_BYTE_GRAY
See Also:   BufferedImage.TYPE_BYTE_BINARY
See Also:   BufferedImage.TYPE_BYTE_INDEXED
See Also:   BufferedImage.TYPE_USHORT_GRAY
See Also:   BufferedImage.TYPE_USHORT_565_RGB
See Also:   BufferedImage.TYPE_USHORT_555_RGB
See Also:   BufferedImage.TYPE_CUSTOM



getWidth
public int getWidth()(Code)
Returns the width of the BufferedImage. the width of this BufferedImage.



getWidth
public int getWidth(ImageObserver observer)(Code)
Returns the actual width of the image. If the width is not known yet then the ImageObserver is notified later and -1 is returned.
Parameters:
  observer - the ImageObserver that receivesinformation about the image the width of the image or -1 if the widthis not yet known.
See Also:   java.awt.Image.getHeight(ImageObserver)
See Also:   ImageObserver



setRGB
public synchronized void setRGB(int x, int y, int rgb)(Code)
Sets a pixel in this BufferedImage to the specified RGB value. The pixel is assumed to be in the default RGB color model, TYPE_INT_ARGB, and default sRGB color space. For images with an IndexColorModel, the index with the nearest color is chosen. x, y the coordinates of the pixel to set
Parameters:
  rgb - the RGB value



setRGB
public void setRGB(int startX, int startY, int w, int h, int[] rgbArray, int offset, int scansize)(Code)
Sets an array of integer pixels in the default RGB color model (TYPE_INT_ARGB) and default sRGB color space, into a portion of the image data. Color conversion takes place if the default model does not match the image ColorModel. There are only 8-bits of precision for each color component in the returned data when using this method. With a specified coordinate (x, y) in the this image, the ARGB pixel can be accessed in this way:
 pixel   = rgbArray[offset + (y-startY)*scansize + (x-startX)];
 
WARNING: No dithering takes place. startX, startY the starting coordinates
Parameters:
  w - width of the region
Parameters:
  h - height of the region
Parameters:
  rgbArray - the rgb pixels
Parameters:
  offset - offset into the rgbArray
Parameters:
  scansize - scanline stride for the rgbArray



toString
public String toString()(Code)
Returns a String representation of this BufferedImage object and its values. a String representing thisBufferedImage.



Fields inherited from java.awt.Image
final public static int SCALE_AREA_AVERAGING(Code)(Java Doc)
final public static int SCALE_DEFAULT(Code)(Java Doc)
final public static int SCALE_FAST(Code)(Java Doc)
final public static int SCALE_REPLICATE(Code)(Java Doc)
final public static int SCALE_SMOOTH(Code)(Java Doc)
final public static Object UndefinedProperty(Code)(Java Doc)

Methods inherited from java.awt.Image
abstract public void flush()(Code)(Java Doc)
abstract public Graphics getGraphics()(Code)(Java Doc)
abstract public int getHeight(ImageObserver observer)(Code)(Java Doc)
abstract public Object getProperty(String name, ImageObserver observer)(Code)(Java Doc)
public Image getScaledInstance(int width, int height, int hints)(Code)(Java Doc)
abstract public ImageProducer getSource()(Code)(Java Doc)
abstract public int getWidth(ImageObserver observer)(Code)(Java Doc)

Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.