public class ImageIOImageWriter extends Object implements ImageWriter, IIOWriteWarningListener
构造器和说明 |
---|
ImageIOImageWriter(String mime)
Main constructor.
|
限定符和类型 | 方法和说明 |
---|---|
MultiImageWriter |
createMultiImageWriter(OutputStream out)
Creates a MultiImageWriter instance that lets you put multiple pages into a single file
if the format supports it.
|
protected IIOMetadata |
createStreamMetadata(ImageWriter writer,
ImageWriteParam writeParam,
ImageWriterParams params)
Creates the stream metadata for image.
|
protected static IIOMetadataNode |
getChildNode(Node n,
String name)
Returns a specific metadata child node
|
protected ImageWriteParam |
getDefaultWriteParam(ImageWriter iiowriter,
RenderedImage image,
ImageWriterParams params)
Returns the default write parameters for encoding the image.
|
String |
getMIMEType() |
boolean |
isFunctional() |
boolean |
supportsMultiImageWriter() |
protected IIOMetadata |
updateMetadata(RenderedImage image,
IIOMetadata meta,
ImageWriterParams params)
Updates the metadata information based on the parameters to this writer.
|
void |
warningOccurred(ImageWriter source,
int imageIndex,
String warning) |
void |
writeImage(RenderedImage image,
OutputStream out)
Encodes an image and writes it to an OutputStream.
|
void |
writeImage(RenderedImage image,
OutputStream out,
ImageWriterParams params)
Encodes an image and writes it to an OutputStream.
|
public ImageIOImageWriter(String mime)
mime
- the MIME type of the image formatpublic void writeImage(RenderedImage image, OutputStream out) throws IOException
writeImage
在接口中 ImageWriter
image
- the image to be encodedout
- the OutputStream to write toIOException
- In case of an /IO problempublic void writeImage(RenderedImage image, OutputStream out, ImageWriterParams params) throws IOException
writeImage
在接口中 ImageWriter
image
- the image to be encodedout
- the OutputStream to write toparams
- a parameters object to customize the encoding.IOException
- In case of an /IO problemprotected IIOMetadata createStreamMetadata(ImageWriter writer, ImageWriteParam writeParam, ImageWriterParams params)
writer
- the image writewriteParam
- the ImageIO write parametersparams
- the ImageWriter write parametersprotected ImageWriteParam getDefaultWriteParam(ImageWriter iiowriter, RenderedImage image, ImageWriterParams params)
iiowriter
- The IIO ImageWriter that will be usedimage
- the image to be encodedparams
- the parameters for this writer instanceprotected IIOMetadata updateMetadata(RenderedImage image, IIOMetadata meta, ImageWriterParams params)
image
- the current image being renderedmeta
- the metadataparams
- the parametersprotected static IIOMetadataNode getChildNode(Node n, String name)
n
- the base nodename
- the name of the childpublic String getMIMEType()
getMIMEType
在接口中 ImageWriter
public boolean isFunctional()
isFunctional
在接口中 ImageWriter
public void warningOccurred(ImageWriter source, int imageIndex, String warning)
warningOccurred
在接口中 IIOWriteWarningListener
public MultiImageWriter createMultiImageWriter(OutputStream out) throws IOException
createMultiImageWriter
在接口中 ImageWriter
out
- the OutputStream to write the image toIOException
- In case of an /IO problempublic boolean supportsMultiImageWriter()
supportsMultiImageWriter
在接口中 ImageWriter
Copyright 1999-2016 The Apache Software Foundation. All Rights Reserved.