Separate names with a comma.
Discussion in 'Mac Programming' started by xiaohuli170, Jan 21, 2009.
I want to shoew a local image on the webview,how to do ,thanks!
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.
Thanks , I got the answer :
NSURL *imageURL = [NSURL fileURLWithPath:localImagePath];
NSURLRequest *request = [NSURLRequest requestWithURL:imageURL];
[[webView mainFrame] loadRequest:request];
Now I want to show few local image of a dic to a webview , How to do ?
Ah yea I forgot the easiest answer
Can you clarify your second question?
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?