title: How to show image in webview?
body: <p>I am trying to show image in UIWebView.But I don't know why my image is not shown in UIWebVeiw. Here is my code.</p>
  
  <pre><code>-(void)pInterest
  {
  UIImage *myImage;
  myImage=imgView.image;
  WebViewController *webViewController = [[WebViewController alloc] initWithNibName:@"WebViewController" bundle:nil];
  webViewController.mypimage = myImage;
  [[[[UIApplication sharedApplication] keyWindow] rootViewController] presentModalViewController:webViewController animated:YES];
  }
  </code></pre>
  
  <p>Now after passing image to WebViewController my WebViewController code is, </p>
  
  <pre><code>- (void)viewDidLoad
  {
  NSData* data = UIImageJPEGRepresentation(mypimage, 1.0f);
  [Base64 initialize];
  NSString *strEncoded = [Base64 encode:data];
   NSMutableString *htmlString = [[NSMutableString alloc] initWithCapacity:1000];
  [htmlString appendFormat:@"&lt;html&gt; &lt;body&gt;"];
  [htmlString appendFormat:@"&lt;p align=\"center\"&gt;&lt;a href=%@ class=\"pin-it-button\" count-layout=\"horizontal\"&gt;&lt;img border=\"0\" src=\"http://assets.pinterest.com/images/PinExt.png\" title=\"Pin It\" /&gt;&lt;/a&gt;&lt;/p&gt;", buttonUrl];
  [htmlString appendFormat:@"&lt;p align=\"center\"&gt;&lt;img width=\"400px\" height = \"400px\" src=%@&gt;&lt;/img&gt;&lt;/p&gt;", imageUrl];
  [htmlString appendFormat:@"&lt;script type=\"text/javascript\" src=\"//assets.pinterest.com/js/pinit.js\"&gt;&lt;/script&gt;"];
  [htmlString appendFormat:@"&lt;/body&gt; &lt;/html&gt;"];
  [mywebview setBackgroundColor:[UIColor clearColor]];
  NSString *path = [[NSBundle mainBundle] bundlePath];
  NSURL *baseURL = [NSURL fileURLWithPath:path];
  [mywebview loadHTMLString:htmlString baseURL:baseURL];
  [mywebview setOpaque:NO];
  }
  </code></pre>
  
  <p>when I tried with this code it show below result.</p>
  
  <p><img src="https://i.stack.imgur.com/ig6kq.png" alt="enter image description here"></p>
  
  <p>Any help will be appriated.Thanks</p>