public final class ImageTool
extends java.lang.Object
Picture overlay tool.
Used to handle the stacking of different images. Such as the two pictures will be combined to the specified format output into a new picture.
Constructor and Description |
---|
ImageTool() |
Modifier and Type | Method and Description |
---|---|
static java.io.InputStream |
getInputStream(java.lang.String sourceUri)
Obtain the corresponding input stream object according to the file address.
|
static void |
merge(java.awt.image.BufferedImage src, java.awt.image.BufferedImage baseImage, java.lang.String target, java.lang.String format)
Image aggregation.
|
static void |
merge(java.io.InputStream inputStream, java.io.InputStream baseInputStream, java.io.OutputStream os, java.lang.String format)
After the image stream pointed to by the parameter inputStream is aggregated with the picture stream specified by the baseInputStream parameter, the new picture is output to the picture stream developed by the parameter os.
|
static void |
merge(java.lang.String source, java.lang.String base, java.lang.String target, java.lang.String format)
After the new source image pointed to by the parameter source is merged with the base picture pointed to by the parameter base, the new image is output to the file pointed to by the parameter target in the format set by the parameter format.
|
public static void merge(java.lang.String source, java.lang.String base, java.lang.String target, java.lang.String format)
After the new source image pointed to by the parameter source is merged with the base picture pointed to by the parameter base, the new image is output to the file pointed to by the parameter target in the format set by the parameter format.
source
- New source image path.base
- The path of the underlying picture.outputPath
- The path of new image after overlays the map image.format
- Image format. The default is PNG format.public static void merge(java.io.InputStream inputStream, java.io.InputStream baseInputStream, java.io.OutputStream os, java.lang.String format) throws java.io.IOException
After the image stream pointed to by the parameter inputStream is aggregated with the picture stream specified by the baseInputStream parameter, the new picture is output to the picture stream developed by the parameter os.
inputStream
- New source image stream, aggregated at the top.inputStream
- The base picture stream is aggregated at the bottom.os
- Image output streamformat
- Image output format.java.io.IOException
- IO Exceptionpublic static void merge(java.awt.image.BufferedImage src, java.awt.image.BufferedImage baseImage, java.lang.String target, java.lang.String format)
Image aggregation.
src
- New source picture, aggregated at the top layer.inputStream
- Base picture, aggregated at the bottom layer.outputPath
- The path of new image after overlays the map image.format
- Image format.public static java.io.InputStream getInputStream(java.lang.String sourceUri)
Obtain the corresponding input stream object according to the file address.
sourceUri
- Document address.