从bitmapdescriptor获取位图

L7C*_*ers 11 android google-maps

是否可以从BitmapDescriptor获取位图?

我正在尝试使用googles api来使我的应用程序更加无缝,但我可以自定义标记选项对象...我认为BitmapDescriptor会扩展FileDescriptor但我没有看到.

dan*_*117 -1

所有BitmapDescriptor都来自BitmapDescriptorFactory。

MediaStore 中 imageId 的自定义标记示例。

final BitmapFactory.Options bmOptions = new BitmapFactory.Options();
            bmOptions.inSampleSize = 8;  //about the size of standard marker

Bitmap bm = MediaStore.Images.Thumbnails.getThumbnail(
                            context.getContentResolver(), newImageId,
                            MediaStore.Images.Thumbnails.MINI_KIND,
                            bmOptions);
                    if (bm != null) {
                        BitmapDescriptor bd = BitmapDescriptorFactory
                                .fromBitmap(bm);
                        if (bd != null) {
                            markeroptions.icon(bd);
Run Code Online (Sandbox Code Playgroud)