How to get image of a WebView???
How to get image of a WebView???
- Subject: How to get image of a WebView???
- From: mradul mandhanya <email@hidden>
- Date: Wed, 16 Feb 2005 04:50:02 -0800 (PST)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
hi all
i am very nw to cocoa programming...and to this grp
too and i have searched teh archive 4 this but
couldnot find a result of my prob....
i have a problem while getting the image or a pdf of a
web view.
i have got the pdf but due to some reason(dont know
why) it is not showing the exact content of the web
site (i tried it with both options direct writing to
pdf or priting to pdf - actually safari itself is not
saving the exact content of the website to PDF ).
i tried to make the TIFF image of the view with
following code :
[[[[[vc webView] mainFrame] frameView] documentView]
lockFocus];
bitmap = [[NSBitmapImageRep alloc]
initWithFocusedViewRect:[[[[[vc webView] mainFrame]
frameView] documentView] frame]];
[[[[[vc webView] mainFrame] frameView] documentView]
unlockFocus];
[[bitmap TIFFRepresentation]
writeToFile:@"webViewImage.TIFF" atomically:YES];
where vc is my outlet to webView... & right now just
testing to save the image to the disk with name
webViewImage.TIFF .
but the problem with this method is that it is giving
me the image of visible protion of the webView only
:-((
Can anyone plzzz suggest me a better way to get image
from a WebView or any view ... which also
includes the portion which is not visible at present.
Thanks a lot!!!!
Pintoo
__________________________________
Do you Yahoo!?
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden