如何在Android中的Drawable图像中删除黑色阴影?

时间:2011-04-23 10:36:49

标签: android

如何在Android中删除Drawable图像中的黑色阴影?enter image description here

        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();

1 个答案:

答案 0 :(得分:0)

您必须继承Overlay类并重写draw()方法。像这样:

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);
    }
}

阴影是使用OverlayItem的默认行为。