public class ImageAsset extends java.lang.Object implements Asset
The ImageAsset represents an image. It contains the uri, measurements, and the unit type.
When created, give it to a PrintItem
Modifier and Type | Class and Description |
---|---|
static class |
ImageAsset.MeasurementUnits
This enum is used to tell the PrintJob how to read the size of the imageAsset.
|
Modifier and Type | Field and Description |
---|---|
static |
CREATOR |
Modifier | Constructor and Description |
---|---|
|
ImageAsset(Context context,
Bitmap bitmap,
ImageAsset.MeasurementUnits measurementUnits,
float width,
float height)
Constructor used to create an ImageAsset with a bitmap.
|
|
ImageAsset(Context context,
int resourceId,
ImageAsset.MeasurementUnits measurementUnits,
float width,
float height)
Constructor used to create an ImageAsset with a resource.
|
|
ImageAsset(Context context,
java.lang.String assetURI,
ImageAsset.MeasurementUnits measurementUnits,
float width,
float height)
Constructor used to create an ImageAsset with an asset located in the "assets" directory.
|
protected |
ImageAsset(Parcel in) |
|
ImageAsset(java.lang.String uri,
ImageAsset.MeasurementUnits measurementUnits,
float width,
float height)
Constructor used to create the image asset.
|
Modifier and Type | Method and Description |
---|---|
int |
describeContents() |
int |
getAssetHeight()
Get the asset height.
|
java.lang.String |
getAssetUri()
Gets the uri of the image asset.
|
int |
getAssetWidth()
Get the asset width.
|
java.lang.String |
getContentType()
Get content type string.
|
Bitmap |
getPrintableBitmap()
Gets the bitmap of the image asset.
|
float |
heightInInches()
Get the height of the image in inches.
|
float |
widthInInches()
Get the width of the image in inches.
|
void |
writeToParcel(Parcel dest,
int flags) |
public ImageAsset(java.lang.String uri, ImageAsset.MeasurementUnits measurementUnits, float width, float height)
uri
- The location of the asset.measurementUnits
- The measurement unit of the width and height.width
- The width of the asset.height
- The height of the asset.public ImageAsset(Context context, int resourceId, ImageAsset.MeasurementUnits measurementUnits, float width, float height)
context
- The context.resourceId
- The resource id.measurementUnits
- The measurement unit of the width and height.width
- The width of the asset.height
- The height of the asset.public ImageAsset(Context context, java.lang.String assetURI, ImageAsset.MeasurementUnits measurementUnits, float width, float height)
context
- The context.assetURI
- The location of the asset within the assets directory.measurementUnits
- The measurement unit of the width and height.width
- The width of the asset.height
- The height of the asset.public ImageAsset(Context context, Bitmap bitmap, ImageAsset.MeasurementUnits measurementUnits, float width, float height)
context
- The context.bitmap
- The bitmap you want to use to create the ImageAsset.measurementUnits
- The measurement unit of the width and height.width
- The width of the asset.height
- The height of the asset.protected ImageAsset(Parcel in)
public Bitmap getPrintableBitmap()
getPrintableBitmap
in interface Asset
public java.lang.String getAssetUri()
getAssetUri
in interface Asset
public float widthInInches()
public float heightInInches()
public int getAssetWidth()
Asset
getAssetWidth
in interface Asset
public int getAssetHeight()
Asset
getAssetHeight
in interface Asset
public java.lang.String getContentType()
Asset
getContentType
in interface Asset
public int describeContents()
public void writeToParcel(Parcel dest, int flags)