Android-将drawablebitmap的边框作为MapView中的标记

时间:2018-10-10 02:18:46

标签: java android base64 border android-drawable

我想为从base64字符串转换为image的drawableBitMap设置边框或笔触。有人可以帮我做到这一点吗?这是我的示例代码:

String base64String = facilitiesOverlayProperties.get(i).getImage();
                byte[] decodedString = Base64.decode(base64String, Base64.DEFAULT);
                Bitmap decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);
                BitmapDrawable bitmapDrawable  = new BitmapDrawable(map.getContext().getResources(), Bitmap.createScaledBitmap(decodedByte, 26, 26, false));
                    mapMarker.setIcon(bitmapDrawable);

由于我不知道如何创建边框或笔触的代码仍然不存在。

1 个答案:

答案 0 :(得分:0)

您可以使用以下方法在位图周围制作圆形边框:

//mMap is your GoogleMap Refrence

mMap.addCircle(new CircleOptions()
            .center(new LatLng(latitude, longitude)).radius(10)
            .strokeColor(0x220000FF)//stroke color
            .strokeWidth(5)
            .fillColor(0x220000FF));//your fill colour