public class ImageWriter extends Object implements Closeable, ImageFileWriter
MetaImage in different formats| Modifier and Type | Class and Description |
|---|---|
static interface |
ImageWriter.Paper
Various paper format.
|
static interface |
ImageWriter.Units |
ImageFileWriter.ImageFileType| Modifier and Type | Field and Description |
|---|---|
static String |
CONFIG_COMPRESSION
A compression (quality) value for JPEG.
|
static String |
CONFIG_PAGE_HEIGHT
A page height for PDFs.
|
static String |
CONFIG_PAGE_PAPER
A page size preset for PRF, such an A4, Letter etc.
|
static String |
CONFIG_PAGE_UNITS
An units for page dimensions.
|
static String |
CONFIG_PAGE_WIDTH
A page width for PDFs.
|
static float |
Extensible
An "infinite" value for page dimensions.
|
static int |
Inches |
static int |
Millimeters |
static int |
PAPER_A4 |
static int |
PAPER_A5 |
static int |
PAPER_A6 |
static int |
PAPER_BUSINESS_CARD |
static int |
PAPER_BUSINESS_CARD2 |
static int |
PAPER_HALF_LETTER |
static int |
PAPER_JUNIOR_LEGAL |
static int |
PAPER_LEGAL |
static int |
PAPER_LEGER |
static int |
PAPER_LETTER |
static int |
PAPER_RECEIPT_KITCHEN |
static int |
PAPER_RECEIPT_MOBILE |
static int |
PAPER_RECEIPT_STATION |
IMAGE_FILE_JPEG, IMAGE_FILE_PNG, IMAGE_FILE_UNKNOWN| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close sequence
|
void |
configure(android.os.Bundle config)
Setup optional parameters
|
void |
destroy()
Deprecated.
|
void |
open(String fileName)
Start to write a new picture sequence
|
String |
write(MetaImage image)
Write one image to current sequence
|
String |
writeFile(String imageFile,
int imageType,
int orientation)
Write specified file.
|
public static final String CONFIG_COMPRESSION
write() methodpublic static final int PAPER_A4
public static final int PAPER_A5
public static final int PAPER_A6
public static final int PAPER_HALF_LETTER
public static final int PAPER_LETTER
public static final int PAPER_LEGAL
public static final int PAPER_JUNIOR_LEGAL
public static final int PAPER_LEGER
public static final int PAPER_BUSINESS_CARD
public static final int PAPER_BUSINESS_CARD2
public static final int PAPER_RECEIPT_MOBILE
public static final int PAPER_RECEIPT_STATION
public static final int PAPER_RECEIPT_KITCHEN
public static final int Millimeters
public static final int Inches
public static final String CONFIG_PAGE_PAPER
ImageWriter.Paper
NOTE: by specify CONFIG_PAGE_WIDTH or CONFIG_PAGE_HEIGHT you can
override one or both paper dimensions.public static final String CONFIG_PAGE_UNITS
Millimeters or Inchespublic static final float Extensible
CONFIG_PAGE_WIDTH and CONFIG_PAGE_HEIGHT cannot be Extensiblepublic static final String CONFIG_PAGE_WIDTH
Extensible to make page proper widthpublic static final String CONFIG_PAGE_HEIGHT
Extensible to make page proper heightpublic void open(@NonNull
String fileName)
throws ImageWriterException
fileName - path to fileImageWriterException - if an error occurspublic void configure(@NonNull
android.os.Bundle config)
throws ImageWriterException
config - a Bundle with named parametersImageWriterException - if an error occurspublic String write(@NonNull MetaImage image) throws ImageWriterException
image - MetaImage to writeopen(String)ImageWriterException - if an error occurspublic void close()
throws ImageWriterException
close in interface Closeableclose in interface AutoCloseableImageWriterException@Deprecated public void destroy() throws ImageWriterException
ImageWriterException - if an error occurspublic String writeFile(@NonNull String imageFile, int imageType, int orientation) throws ImageWriterException
ImageFileWriterwriteFile in interface ImageFileWriterimageFile - file to writeimageType - file type. One of ImageFileWriter.ImageFileType (but not -1orientation - optional EXIF orientation valuewrite(MetaImage)ImageWriterException - if an error occurs