title: How to make bitmap transparent?
body: <pre><code>/**
   * @param bitmap
   *            The source bitmap.
   * @param opacity
   *            a value between 0 (completely transparent) and 255 (completely
   *            opaque).
   * @return The opacity-adjusted bitmap. If the source bitmap is mutable it
   *         will be adjusted and returned, otherwise a new bitmap is created.
   *         Source : http://stackoverflow.com/questions/7392062/android-
   *         semitransparent-bitmap-background-is-black/14858913#14858913
   */
  private Bitmap adjustOpacity(Bitmap bitmap, int opacity) {
      Bitmap mutableBitmap = bitmap.isMutable() ? bitmap : bitmap.copy(Bitmap.Config.ARGB_8888, true);
      Canvas canvas = new Canvas(mutableBitmap);
      int colour = (opacity &amp; 0xFF) &lt;&lt; 24;
      canvas.drawColor(colour, PorterDuff.Mode.DST_IN);
      return mutableBitmap;
  }
  </code></pre>
  
  <p>Using <code>adjustOpacity</code>, I make <code>ImageView</code>'s <code>Bitmap</code> be semi-transparent.</p>
  
  <pre><code>Bitmap newBitmap = adjustOpacity(orignalBitmap, 10);
  view.setImageBitmap(newBitmap);
  view.setBackgroundColor(Color.WHITE);
  </code></pre>
  
  <p>However, <code>Imageview</code> show more darkent before not white. How do I make a semi-transparent (white background) Imageview with <code>Bitmap</code>?</p>