android.support.v4.print
Class PrintHelperKitkat

java.lang.Object
  extended by android.support.v4.print.PrintHelperKitkat

public class PrintHelperKitkat
extends java.lang.Object

Kitkat specific PrintManager API implementation.


Field Summary
static int COLOR_MODE_COLOR
          this is a color image (default)
static int COLOR_MODE_MONOCHROME
          this is a black and white image
static int SCALE_MODE_FILL
          image will fill the paper and be cropped (default)
static int SCALE_MODE_FIT
          image will be scaled but leave white space
 
Method Summary
 int getColorMode()
          Gets the color mode with which the image will be printed.
 int getScaleMode()
          Returns the scale mode with which the image will fill the paper.
 void printBitmap(java.lang.String jobName, android.graphics.Bitmap bitmap)
          Prints a bitmap.
 void printBitmap(java.lang.String jobName, android.net.Uri imageFile)
          Prints an image located at the Uri.
 void setColorMode(int colorMode)
          Sets whether the image will be printed in color (default) COLOR_MODE_COLOR or in back and white COLOR_MODE_MONOCHROME.
 void setScaleMode(int scaleMode)
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCALE_MODE_FIT

public static final int SCALE_MODE_FIT
image will be scaled but leave white space

See Also:
Constant Field Values

SCALE_MODE_FILL

public static final int SCALE_MODE_FILL
image will fill the paper and be cropped (default)

See Also:
Constant Field Values

COLOR_MODE_MONOCHROME

public static final int COLOR_MODE_MONOCHROME
this is a black and white image

See Also:
Constant Field Values

COLOR_MODE_COLOR

public static final int COLOR_MODE_COLOR
this is a color image (default)

See Also:
Constant Field Values
Method Detail

setScaleMode

public void setScaleMode(int scaleMode)
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.

Parameters:
scaleMode - SCALE_MODE_FIT or SCALE_MODE_FILL

getScaleMode

public int getScaleMode()
Returns the scale mode with which the image will fill the paper.

Returns:
The scale Mode: SCALE_MODE_FIT or SCALE_MODE_FILL

setColorMode

public void setColorMode(int colorMode)
Sets whether the image will be printed in color (default) COLOR_MODE_COLOR or in back and white COLOR_MODE_MONOCHROME.

Parameters:
colorMode - The color mode which is one of COLOR_MODE_COLOR and COLOR_MODE_MONOCHROME.

getColorMode

public int getColorMode()
Gets the color mode with which the image will be printed.

Returns:
The color mode which is one of COLOR_MODE_COLOR and COLOR_MODE_MONOCHROME.

printBitmap

public void printBitmap(java.lang.String jobName,
                        android.graphics.Bitmap bitmap)
Prints a bitmap.

Parameters:
jobName - The print job name.
bitmap - The bitmap to print.

printBitmap

public void printBitmap(java.lang.String jobName,
                        android.net.Uri imageFile)
                 throws java.io.FileNotFoundException
Prints an image located at the Uri. Image types supported are those of BitmapFactory.decodeStream (JPEG, GIF, PNG, BMP, WEBP)

Parameters:
jobName - The print job name.
imageFile - The Uri pointing to an image to print.
Throws:
java.io.FileNotFoundException - if Uri is not pointing to a valid image.