We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All

Documents from this version have been archived, and will not continue to be maintained. Please use the latest version.

HMS Core ReferencesMap KitAndroid SDKcom.huawei.hms.maps.modelBitmapDescriptorFactory

BitmapDescriptorFactory

public final class BitmapDescriptorFactory

Creates the definition of a bitmap image.

Public Fields

NameTypeDescription
HUE_AZUREpublic static final floatAzure.
HUE_BLUEpublic static final floatBlue.
HUE_CYANpublic static final floatCyan.
HUE_GREENpublic static final floatGreen.
HUE_MAGENTApublic static final floatMagenta.
HUE_ORANGEpublic static final floatOrange.
HUE_REDpublic static final floatRed.
HUE_ROSEpublic static final floatRose.
HUE_VIOLETpublic static final floatViolet.
HUE_YELLOWpublic static final floatYellow.

Constructor

None.

Public Method Summary

Return typeMethod name
static BitmapDescriptordefaultMarker(float hue)
static BitmapDescriptordefaultMarker()
static BitmapDescriptorfromAsset(String assetName)
static BitmapDescriptorfromBitmap(Bitmap image)
static BitmapDescriptorfromFile(String fileName)
static BitmapDescriptorfromPath(String absolutePath)
static BitmapDescriptorfromResource(int resourceId)

Public Methods

Method
public static BitmapDescriptor defaultMarker(float hue)
Creates BitmapDescriptor objects for default marker icons in different colors using different hue values.
The BitmapDescriptorFactory class provides 10 hue values. You can call this method by transferring a hue value. For details, please refer to public fields of this class.


Parameters:

Parameter nameParameter desc
hueHue value.


Return:

Return typeParameter desc
BitmapDescriptorBitmapDescriptor object.
Method
public static BitmapDescriptor defaultMarker()
Creates a BitmapDescriptor object for a default marker icon.


Parameters:
None.
Return:

Return typeParameter desc
BitmapDescriptorBitmapDescriptor object.
Method
public static BitmapDescriptor fromAsset(String assetName)
Creates a BitmapDescriptor object using an image resource in the assets directory.


Parameters:

Parameter nameParameter desc
assetNameImage path in assets, including the image name.


Return:

Return typeParameter desc
BitmapDescriptorBitmapDescriptor object. If the image does not exist, null is returned.
Method
public static BitmapDescriptor fromBitmap(Bitmap image)

Creates a BitmapDescriptor object using a bitmap image.


Parameters:

Parameter nameParameter desc
imageBitmap image.


Return:

Return typeParameter desc
BitmapDescriptorBitmapDescriptor object. If null is passed for the input parameter, null is returned.
Method
public static BitmapDescriptor fromFile(String fileName)
Creates a BitmapDescriptor object using the name of an image file in the internal storage.


Parameters:

Parameter nameParameter desc
fileNameName of an image file in the internal storage.


Return:

Return typeParameter desc
BitmapDescriptorBitmapDescriptor object. If the file does not exist, null is returned.
Method
public static BitmapDescriptor fromPath(String absolutePath)
Creates a BitmapDescriptor object using the absolute path to an image resource.


Parameters:

Parameter nameParameter desc
absolutePathAbsolute file path of an image.


Return:

Return typeParameter desc
BitmapDescriptorBitmapDescriptor object. If the file does not exist, null is returned.
Method
public static BitmapDescriptor fromResource(int resourceId)

Creates a BitmapDescriptor object using the resource ID of an image.


Parameters:

Parameter nameParameter desc
resourceIdResource ID of a bitmap image.


Return:

Return typeParameter desc
BitmapDescriptorBitmapDescriptor object. If the file does not exist, null is returned.
This page may contain third-party content. For details, click here.
Search in References
Enter a keyword.