Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
There are two ways. One is to add an NSImageView as a subview, the other is to create a temp HTML page with the <img> element.
 

xiaohuli170

macrumors newbie
Original poster
Jan 13, 2009
27
0
Thanks , I got the answer :
NSURL *imageURL = [NSURL fileURLWithPath:localImagePath];
NSURLRequest *request = [NSURLRequest requestWithURL:imageURL];
[[webView mainFrame] loadRequest:request];
 

xiaohuli170

macrumors newbie
Original poster
Jan 13, 2009
27
0
first Thanks a lot.
My second question is that I want to show some images of one directory to the webview, because I can show a image to the webview ,but some images ? How to do ? by the way , I want to click a button and to open the homeDirectory and choose a directory , some images within it will show in the webview, how to do? I found a similar sample, the path is :/developer/examples/webkit/picturebrowser. but it is hard . I want to a simple demo or code ,how to do?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.