title: Data URL / PNG from UIImage
body: <p>I have a iPhone program that has a UIImage. This UIImage needs to be transferred to a javascript Image object in a UIWebView. I was thinking this could be done by using a data url I send to the UIWebView like this:</p>
  
  <pre><code>[wview stringByEvaluatingJavaScriptFromString:@"loadimage('%d')",dataurlfromuiimage];
  </code></pre>
  
  <p>So, I need to transfer my UIImage into a Data: URL. I could do this myself if I can just get the PNG data, but I cannot find how do do that either. If there is a better way to send this to the WebView, that would be good also.</p>