public class IconUtilities
extends java.lang.Object
Constructor and Description |
---|
IconUtilities() |
Modifier and Type | Method and Description |
---|---|
static android.graphics.Bitmap |
decodeBitmap(java.lang.String encoded)
Given a base64:// encoded image, decode into a bitmap
|
static java.lang.String |
encodeBitmap(android.graphics.Bitmap bitmap)
Given a bitmap, return an encoded base64:// asset that can be used in areas where an icon.
|
static android.graphics.Bitmap |
getBitmap(android.content.Context context,
int drawableId)
Given a drawable resource turn it into a bitmap
|
static android.graphics.Bitmap |
getBitmap(android.graphics.drawable.Drawable drawable)
Given a drawable resource turn it into a bitmap
|
static android.graphics.Bitmap |
getBitmap(android.graphics.drawable.Drawable drawable,
int width,
int height)
Given a drawable resource turn it into a bitmap
|
static void |
setIcon(android.content.Context context,
Marker marker,
int res,
boolean adapt)
Given a drawable resource, create a bitmap and then encode the bitmap as an icon.
|
public static void setIcon(android.content.Context context, Marker marker, int res, boolean adapt)
context
- The context to usemarker
- The marker to set the iconres
- The drawable resource to be used.adapt
- True if the icon can be adapted when the type is changed. This means that the
icon will be replaced with an appropriate icon for the new type. False if the
icon is considered permanently set and can only be changed by manually calling
this method again.public static android.graphics.Bitmap getBitmap(android.content.Context context, int drawableId)
context
- The context to use for looking up the drawabledrawableId
- The resource ID for the drawablepublic static android.graphics.Bitmap getBitmap(android.graphics.drawable.Drawable drawable, int width, int height)
drawable
- Drawable iconwidth
- Desired bitmap widthheight
- Desired bitmap heightpublic static android.graphics.Bitmap getBitmap(android.graphics.drawable.Drawable drawable)
drawable
- Drawable iconpublic static java.lang.String encodeBitmap(android.graphics.Bitmap bitmap)
bitmap
- the bitmap to encode as base64://public static android.graphics.Bitmap decodeBitmap(java.lang.String encoded)
encoded
- The encoded image to get the bitmap from. Must start with base64://