我有一个我在地图上显示的自定义地图标记,但是当我绘制它们时,标记看起来很模糊,就像在查看原始分辨率时更改了分辨率
这是原作
我不同的颜色
这是他们在地图上绘制它们时的样子
正如你所看到的那样,边缘看起来与原始像素相比都是像素化的,并且我使用的图像尺寸似乎并不重要。
使用BitmapDescriptorFactory.fromResource(R.drawable.blue)真的会降低图像的质量吗?
如何在Google即时中让它们看起来像这样高质量
我需要使用一些特殊的图像尺寸来使它们看起来更好或者更好吗?
这就是我绘制地图的方式
mGoogleMap.addMarker(new MarkerOptions().position(point).icon(BitmapDescriptorFactory.fromResource(R.drawable.blue)));I have a custom map marker that I show on the map, but when I plot them the markers look blurry like the resolution was changed when looking at the original
this is the original
and I different colors of that
this is how they look when I plot them on the map
as you can see the edges looks all pixelated compared to the original one and it does not seem to matter what size image I use either.
Does using BitmapDescriptorFactory.fromResource(R.drawable.blue) really degrade the quality of the image?
how can I get them to look high quality like this in Google Now
are there some special image dimensions I need to use to get them to look better or something?
This is how I plot to the map
mGoogleMap.addMarker(new MarkerOptions().position(point).icon(BitmapDescriptorFactory.fromResource(R.drawable.blue)));最满意答案
这里的问题可以如下
您可能正在使用适用于mdpi或hdpi的drawable,并且您正在使用xhdpi屏幕。尝试为所有drawables文件夹添加drawables,然后看到标记,我遇到了类似的问题,这有帮助。 或者使用nodpi文件夹,它将防止图像缩放。
The problem here can the following
You might be using the drawable which is good for mdpi or hdpi and you are using xhdpi screen.Try adding drawables for all the drawables folder and then see the marker, i have faced the similar issue and this helped. Or use nodpi folder it will prevent images from getting scaled.
更多推荐
发布评论