[英]How to remove black shade in the Drawable image in Android?
How to remove black shade in the Drawable image in Android? 如何在Android中的Drawable图像中消除黑色阴影?
Drawable d = new BitmapDrawable(bitmap);mapController.animateTo(geoPoint);
mapOverlay = new MapOverlay(d);
listOfOverlays = mapView.getOverlays();
// listOfOverlays.clear();
listOfOverlays.add(mapOverlay);
overlayitem = new OverlayItem(geoPoint, "", "");
mapOverlay.addOverlay(overlayitem);
listOfOverlays.add(mapOverlay);
mapView.invalidate();
You have to subclass an Overlay
class and override the draw()
method. 您必须继承
Overlay
类并重写draw()
方法。 Like this: 像这样:
public class MyOverlay extends Overlay
{
.....
// obtain the BitMap of the image you want to draw on map
.....
@Override
public void draw(Canvas canvas, MapView mapView, boolean shadow)
{
.....
// draw the BitMap on the canvas
.....
super.draw(canvas, mapView, false);
}
}
The shadow is the default behavior of using OverlayItem
. 阴影是使用
OverlayItem
的默认行为。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.