title: Generate bitmap from HTML in Android
body: <p>How do can you generate a bitmap from HTML in Android?</p>
  
  <p>Can the <code>WebView</code> be used for this or is there a better approach (like maybe using the <code>WebView</code> rendering engine directly)? How?</p>
  
  <p>I would like to implement the following method...</p>
  
  <pre><code>public Bitmap toBitmap(Context context, String html, Rect rect);
  </code></pre>
  
  <p>...where <code>html</code> is the html to render and <code>rect</code> is the frame of the desired bitmap.</p>