【发布时间】:2013-02-06 00:14:19
【问题描述】:
是否可以从BitmapDescriptor 获取位图?
我正在尝试使用 googles api 使我的应用程序更加简洁,但我可以制作自定义标记选项对象...我认为 BitmapDescriptor 会扩展 FileDescriptor 但我没有看到。
【问题讨论】:
-
找到这个运气好吗?
标签: android google-maps
是否可以从BitmapDescriptor 获取位图?
我正在尝试使用 googles api 使我的应用程序更加简洁,但我可以制作自定义标记选项对象...我认为 BitmapDescriptor 会扩展 FileDescriptor 但我没有看到。
【问题讨论】:
标签: android google-maps
所有的 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);
【讨论】: