public class ImageGraphics2D extends PixelGraphics2D
| Modifier and Type | Field and Description | 
|---|---|
| static String | ANTIALIAS | 
| static String | ANTIALIAS_TEXT | 
| static String | BACKGROUND | 
| static String | BACKGROUND_COLOR | 
| protected Component | component | 
| static String | COMPRESS | 
| static String | COMPRESS_DESCRIPTION | 
| static String | COMPRESS_MODE | 
| static String | COMPRESS_QUALITY | 
| protected String | format | 
| protected BufferedImage | image | 
| protected OutputStream | os | 
| static String | PROGRESSIVE | 
| static String | rootKey | 
| static String | TRANSPARENT | 
hostGraphics, KEY_SYMBOL_BLIT, lineWidth, resolution, tagHandler, VALUE_SYMBOL_BLIT_OFF, VALUE_SYMBOL_BLIT_ONNUMBER_OF_HORIZ_ALIGNMENTS, NUMBER_OF_SYMBOLS, NUMBER_OF_VERTICAL_ALIGNMENTS, SYMBOL_BOX, SYMBOL_CIRCLE, SYMBOL_CROSS, SYMBOL_DIAMOND, SYMBOL_DN_TRIANGLE, SYMBOL_HLINE, SYMBOL_PLUS, SYMBOL_STAR, SYMBOL_UP_TRIANGLE, SYMBOL_VLINE, TEXT_BASELINE, TEXT_BOTTOM, TEXT_CENTER, TEXT_LEFT, TEXT_RIGHT, TEXT_TOP| Modifier | Constructor and Description | 
|---|---|
|   | ImageGraphics2D(File file,
               Component component,
               String format) | 
|   | ImageGraphics2D(File file,
               Dimension size,
               String format) | 
| protected  | ImageGraphics2D(ImageGraphics2D graphics) | 
|   | ImageGraphics2D(OutputStream os,
               Component component,
               String format) | 
|   | ImageGraphics2D(OutputStream os,
               Dimension size,
               String format) | 
| Modifier and Type | Method and Description | 
|---|---|
| static boolean | canWriteTransparent(String format) | 
| static boolean | canWriteUncompressed(String format) | 
| void | closeStream() | 
| Graphics | create() | 
| Graphics | create(double x,
      double y,
      double width,
      double height) | 
| static BufferedImage | createBufferedImage(String format,
                   int width,
                   int height)creates an empty image | 
| void | endExport() | 
| static BufferedImage | generateThumbnail(Component component,
                 Dimension size) | 
| static Properties | getDefaultProperties(String format) | 
| static SortedSet<ImageWriter> | getImageWriters(Iterator<?> iterator) | 
| static ImageWriter | getPreferredImageWriter(String format) | 
| static ImageWriter | getPreferredImageWriterForMIMEType(String mimeType) | 
| static UserProperties | getRAWProperties(Color bkg,
                String code) | 
| protected void | handleException(Exception exception)Handles an exception which has been caught. | 
| static BufferedImage | readImage(String format,
         InputStream is) | 
| void | setProperties(Properties newProperties) | 
| void | startExport() | 
| static byte[] | toByteArray(RenderedImage image,
           String format,
           String encoding,
           Properties props)Converts a given image to byte[] | 
| protected void | write() | 
| static void | writeImage(Image image,
          String format,
          Properties properties,
          OutputStream os) | 
| static void | writeImage(RenderedImage image,
          String format,
          Properties properties,
          OutputStream os) | 
addRenderingHints, clearRect, clearRect, clip, clipRect, clipRect, copyArea, createShape, dispose, draw, drawArc, drawGlyphVector, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawLine, drawOval, drawPolygon, drawPolygon, drawPolyline, drawRect, drawRenderableImage, drawRenderedImage, drawString, drawString, drawString, drawString, drawString, drawSymbol, fill, fillAndDrawSymbol, fillArc, fillOval, fillPolygon, fillPolygon, fillRect, fillSymbol, getClip, getClipBounds, getClipBounds, getComposite, getDeviceConfiguration, getFontMetrics, getFontRenderContext, getRenderingHint, getRenderingHints, getStroke, getTransform, hit, isDisplayLocal, isDisplayX11, printComment, rotate, rotate, scale, setBackground, setClip, setClip, setClip, setColor, setComposite, setFont, setHostGraphics, setLineWidth, setPaint, setPaintMode, setRenderingHint, setRenderingHints, setStroke, setTransform, setXORMode, shear, toString, transform, translate, translatecreateShape, drawArc, drawLine, drawOval, drawPolygon, drawPolyline, drawRect, drawRoundRect, drawRoundRect, drawString, drawString, drawString, drawString, drawString, drawSymbol, drawSymbol, fillAndDraw, fillAndDrawSymbol, fillArc, fillOval, fillPolygon, fillRect, fillRoundRect, fillRoundRect, fillSymbol, fillSymbol, getBackground, getColor, getColorMode, getCreator, getFont, getPaint, getPrintColor, getProperties, getProperty, getPropertyColor, getPropertyDimension, getPropertyDouble, getPropertyInsets, getPropertyInt, getPropertyRectangle, initProperties, isDeviceIndependent, isProperty, setColorMode, setCreator, setDeviceIndependent, setLineWidthcreate, create, fill, getSymbol, getTextAlignment, getXalignment, getYalignmentdraw3DRect, fill3DRectdrawBytes, drawChars, finalize, getClipRect, getFontMetrics, hitClippublic static final String rootKey
public static final String TRANSPARENT
public static final String BACKGROUND
public static final String BACKGROUND_COLOR
public static final String ANTIALIAS
public static final String ANTIALIAS_TEXT
public static final String PROGRESSIVE
public static final String COMPRESS
public static final String COMPRESS_MODE
public static final String COMPRESS_DESCRIPTION
public static final String COMPRESS_QUALITY
protected OutputStream os
protected BufferedImage image
protected String format
protected Component component
public ImageGraphics2D(File file, Dimension size, String format) throws FileNotFoundException
FileNotFoundExceptionpublic ImageGraphics2D(File file, Component component, String format) throws FileNotFoundException
FileNotFoundExceptionpublic ImageGraphics2D(OutputStream os, Dimension size, String format)
public ImageGraphics2D(OutputStream os, Component component, String format)
protected ImageGraphics2D(ImageGraphics2D graphics)
public static Properties getDefaultProperties(String format)
public void setProperties(Properties newProperties)
setProperties in class AbstractVectorGraphicspublic Graphics create()
create in class PixelGraphics2Dpublic Graphics create(double x, double y, double width, double height)
create in class PixelGraphics2Dpublic void startExport()
startExport in class PixelGraphics2Dpublic void endExport()
endExport in class PixelGraphics2Dprotected void write()
              throws IOException
IOExceptionpublic void closeStream()
                 throws IOException
IOExceptionprotected void handleException(Exception exception)
exception - to be handledpublic static BufferedImage createBufferedImage(String format, int width, int height)
format - e.g. ImageConstants.BMP or {ImageConstants#PNG}width - image widthheight - image heightpublic static BufferedImage generateThumbnail(Component component, Dimension size)
public static void writeImage(Image image, String format, Properties properties, OutputStream os) throws IOException
IOExceptionpublic static void writeImage(RenderedImage image, String format, Properties properties, OutputStream os) throws IOException
IOExceptionpublic static ImageWriter getPreferredImageWriter(String format)
public static ImageWriter getPreferredImageWriterForMIMEType(String mimeType)
public static SortedSet<ImageWriter> getImageWriters(Iterator<?> iterator)
public static BufferedImage readImage(String format, InputStream is) throws IOException
IOExceptionpublic static boolean canWriteUncompressed(String format)
public static boolean canWriteTransparent(String format)
public static UserProperties getRAWProperties(Color bkg, String code)
bkg - Background color for the imagecode - Color encoding, e.g. ImageConstants.COLOR_MODEL_RGBpublic static byte[] toByteArray(RenderedImage image, String format, String encoding, Properties props) throws IOException
image - Image to convertformat - e.g. ImageConstants.JPG, ImageConstants.PNG, ImageConstants.RAWprops - Properties for writing, e.g. RawImageWriteParam.BACKGROUNDencoding - ImageConstants.ENCODING_ASCII85, ImageConstants.ENCODING_FLATE or nullIOException - thrown by writeImage(java.awt.image.RenderedImage, String, java.util.Properties, java.io.OutputStream)Copyright © 2014. All rights reserved.