可以将BitmapDescriptor转换为Bitmap吗? [英] Is possible convert BitmapDescriptor to Bitmap?

查看:659
本文介绍了可以将BitmapDescriptor转换为Bitmap吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将BitmapDescriptor转换为Bitmap.

I need to convert BitmapDescriptor to Bitmap.

我可以使用以下代码将位图转换为BitmapDescriptor:

I can convert a bitmap to BitmapDescriptor with this code:

BitmapDescriptor bd = BitmapDescriptorFactory.fromBitmap(bitmap);

但是我怎么做相反的方式呢?

but how can i do the inverse way ?

我需要获取位图格式的BitmapDescriptorFactory.defaultMarker().

I need to get BitmapDescriptorFactory.defaultMarker() in bitmap format.

推荐答案

我不确定,但我不认为有可能

I m not sure but I don't think so it is possible

在我的应用程序中,我需要更改默认市场颜色...我使用下面的代码将默认标记作为位图,希望对您有帮助

In my application i have requirement to change default market color ...i got the default marker as bitmap using below code hope it helps u

Drawable d = DrawableUtils.resizeImageToDrawable(
                    MapViewFragment.mapViewActivity,
                    Configuration.Display.getDrawableFix(i),
                    Configuration.MapView.getWaypointIconWidth(),
                    Configuration.MapView.getWaypointIconHeight());
d.setColorFilter(color, Mode.MULTIPLY);

Bitmap b = ((BitmapDrawable) d).getBitmap();
Canvas myCanvas = new Canvas(b);

int myColor = b.getPixel(0,0);
ColorFilter filter = new LightingColorFilter(myColor, color);

如果您有任何疑问可以问

If any questions u can ask

这篇关于可以将BitmapDescriptor转换为Bitmap吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆