public class PNGEncoder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static byte |
BW_MODE
black and white image mode.
|
static byte |
COLOR_MODE
full color image mode.
|
static byte |
GREYSCALE_MODE
grey scale image mode.
|
Constructor and Description |
---|
PNGEncoder(java.io.OutputStream out)
public constructor of PNGEncoder class with greyscale mode by default.
|
PNGEncoder(java.io.OutputStream out,
byte mode)
public constructor of PNGEncoder class.
|
Modifier and Type | Method and Description |
---|---|
static void |
captureScreen(java.awt.Component comp,
java.lang.String fileName)
Static method performing one component screen capture into PNG image format file with given fileName.
|
static void |
captureScreen(java.awt.Component comp,
java.lang.String fileName,
byte mode)
Static method performing one component screen capture into PNG image format file with given fileName.
|
static void |
captureScreen(java.awt.Rectangle rect,
java.lang.String fileName)
Static method performing screen capture into PNG image format file with given fileName.
|
static void |
captureScreen(java.awt.Rectangle rect,
java.lang.String fileName,
byte mode)
Static method performing screen capture into PNG image format file with given fileName.
|
static void |
captureScreen(java.lang.String fileName)
Static method performing whole screen capture into PNG image format file with given fileName.
|
static void |
captureScreen(java.lang.String fileName,
byte mode)
Static method performing whole screen capture into PNG image format file with given fileName.
|
void |
encode(java.awt.image.BufferedImage image)
main encoding method (stays blocked till encoding is finished).
|
public static final byte BW_MODE
public static final byte GREYSCALE_MODE
public static final byte COLOR_MODE
public PNGEncoder(java.io.OutputStream out)
out
- output stream for PNG image format to write intopublic PNGEncoder(java.io.OutputStream out, byte mode)
out
- output stream for PNG image format to write intomode
- BW_MODE, GREYSCALE_MODE or COLOR_MODEpublic void encode(java.awt.image.BufferedImage image) throws java.io.IOException
image
- BufferedImage to encodejava.io.IOException
- IOExceptionpublic static void captureScreen(java.awt.Rectangle rect, java.lang.String fileName)
rect
- Rectangle of screen to be capturedfileName
- file name for screen capture PNG image filepublic static void captureScreen(java.awt.Rectangle rect, java.lang.String fileName, byte mode)
rect
- Rectangle of screen to be capturedmode
- image color modefileName
- file name for screen capture PNG image filepublic static void captureScreen(java.awt.Component comp, java.lang.String fileName)
comp
- Component to be capturedfileName
- String image target filenamepublic static void captureScreen(java.awt.Component comp, java.lang.String fileName, byte mode)
comp
- Component to be capturedfileName
- String image target filenamemode
- image color modepublic static void captureScreen(java.lang.String fileName)
fileName
- String image target filenamepublic static void captureScreen(java.lang.String fileName, byte mode)
fileName
- String image target filenamemode
- image color mode