title: Converting a Drawable to a Bitmap to change the color of a Marker in Google Maps Android API v2
body: <p>I'm converting an old application from v1 to v2, and I'm having a problem with the color of my Marker icons. I have a basic, white icon, and It needs to be colorized.</p>
  
  <p>In v1, I did it this way :</p>
  
  <pre><code>Drawable d = DrawableUtils.resizeImageToDrawable(
      MapViewFragment.mapviewActivity,
      Configuration.Display.getDrawableFix(i),
      Configuration.MapView.getWaypointIconWidth(),
      Configuration.MapView.getWaypointIconHeight());
  d.setColorFilter(color, Mode.MULTIPLY);
  
  overlay = new MyFplnFixListItimizedOverlay(d);
  </code></pre>
  
  <p>Since v2 Markers do not accept Drawables for their icons, I thought about converting the Drawable to a Bitmap, like this :</p>
  
  <pre><code>Drawable d = DrawableUtils.resizeImageToDrawable(
      MapViewFragment.mapviewActivity,
      Configuration.Display.getDrawableFix(i),
      Configuration.MapView.getWaypointIconWidth(),
      Configuration.MapView.getWaypointIconHeight());
  d.setColorFilter(color, Mode.MULTIPLY);
  
  Bitmap icon = ((BitmapDrawable) d).getBitmap();
  
  Marker marker = MapViewFragment.map.addMarker(new MarkerOptions()
      .position(point)
      .title(Integer.toString(fplnType))
      .visible(true)
      .icon(BitmapDescriptorFactory.fromBitmap(icon)));
  </code></pre>
  
  <p>But for some reason, it's not working. The icons stay white. Anyone knows why ?</p>
  
  <p>Thanks in advance.</p>