java.lang.Object | |
↳ | android.support.v4.print.PrintHelper |
Helper for printing bitmaps.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
PrintHelper.OnPrintFinishCallback | Callback for observing when a print operation is completed. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | COLOR_MODE_COLOR | this is a color image (default) | |||||||||
int | COLOR_MODE_MONOCHROME | this is a black and white image | |||||||||
int | ORIENTATION_LANDSCAPE | Print the image in landscape orientation (default). | |||||||||
int | ORIENTATION_PORTRAIT | Print the image in portrait orientation. | |||||||||
int | SCALE_MODE_FILL | image will fill the paper and be cropped (default) | |||||||||
int | SCALE_MODE_FIT | image will be scaled but leave white space |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the PrintHelper that can be used to print images.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gets the color mode with which the image will be printed.
| |||||||||||
Gets whether the image will be printed in landscape or portrait.
| |||||||||||
Returns the scale mode with which the image will fill the paper.
| |||||||||||
Prints an image located at the Uri.
| |||||||||||
Prints a bitmap.
| |||||||||||
Prints an image located at the Uri.
| |||||||||||
Prints a bitmap.
| |||||||||||
Sets whether the image will be printed in color (default)
COLOR_MODE_COLOR or in back and white
COLOR_MODE_MONOCHROME .
| |||||||||||
Sets whether the image will be printed in landscape
ORIENTATION_LANDSCAPE (default)
or portrait ORIENTATION_PORTRAIT .
| |||||||||||
Selects whether the image will fill the paper and be cropped
SCALE_MODE_FIT
or whether the image will be scaled but leave white space
SCALE_MODE_FILL .
| |||||||||||
Gets whether the system supports printing.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
this is a color image (default)
this is a black and white image
Print the image in landscape orientation (default).
Print the image in portrait orientation.
image will fill the paper and be cropped (default)
image will be scaled but leave white space
Returns the PrintHelper that can be used to print images.
context | A context for accessing system resources. |
---|
PrintHelper
to support printing images.
Gets the color mode with which the image will be printed.
COLOR_MODE_COLOR
and COLOR_MODE_MONOCHROME
.
Gets whether the image will be printed in landscape or portrait.
ORIENTATION_LANDSCAPE
or ORIENTATION_PORTRAIT
.
Returns the scale mode with which the image will fill the paper.
SCALE_MODE_FIT
or
SCALE_MODE_FILL
Prints an image located at the Uri. Image types supported are those of
android.graphics.BitmapFactory.decodeStream(java.io.InputStream)
jobName | The print job name. |
---|---|
imageFile | The Uri pointing to an image to print. |
callback | Optional callback to observe when printing is finished. |
FileNotFoundException | if Uri is not pointing to a valid image. |
---|
Prints a bitmap.
jobName | The print job name. |
---|---|
bitmap | The bitmap to print. |
Prints an image located at the Uri. Image types supported are those of
android.graphics.BitmapFactory.decodeStream(java.io.InputStream)
jobName | The print job name. |
---|---|
imageFile | The Uri pointing to an image to print. |
FileNotFoundException | if Uri is not pointing to a valid image.
|
---|
Prints a bitmap.
jobName | The print job name. |
---|---|
bitmap | The bitmap to print. |
callback | Optional callback to observe when printing is finished. |
Sets whether the image will be printed in color (default)
COLOR_MODE_COLOR
or in back and white
COLOR_MODE_MONOCHROME
.
colorMode | The color mode which is one of
COLOR_MODE_COLOR and COLOR_MODE_MONOCHROME .
|
---|
Sets whether the image will be printed in landscape ORIENTATION_LANDSCAPE
(default)
or portrait ORIENTATION_PORTRAIT
.
orientation | The page orientation which is one of
ORIENTATION_LANDSCAPE or ORIENTATION_PORTRAIT .
|
---|
Selects whether the image will fill the paper and be cropped
SCALE_MODE_FIT
or whether the image will be scaled but leave white space
SCALE_MODE_FILL
.
scaleMode | SCALE_MODE_FIT or
SCALE_MODE_FILL
|
---|
Gets whether the system supports printing.