Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bilt HIView to Offscreen bitmap



On Mar 13, 2007, at 11:55 AM, Eric Schlegel wrote:

On Mar 13, 2007, at 11:43 AM, Jeff Sparks wrote:

I'd have to actually debug this to be sure, but I bet that the web view is not going to work with CreateOffscreenImage because it's really an NSView embedded inside an HIView, and it uses AppKit's drawing code rather than Carbon's. If that's the case, there's probably no way to get this to work the way you want. You might be able to capture the window bits by just going through QuickDraw to get the window's port's buffer, and then creating a CGImage from those bits.

If you don't mind getting a PDF of the view instead, you can do this incantation to go from an HIWebView to a PDF the entire view


WebView * webView = HIWebViewGetWebView( theHIWebView );
NSView * renderView = [[[webView mainFrame] frameView] documentView];
NSRect bounds = [renderView bounds];
NSData * pdfData = [renderView dataWithPDFInsideRect:bounds];
CGDataProviderRef pdfProvider = CGDataProviderCreateWithCFData ((CFDataRef)pdfData);
CGPDFDocumentRef pdfDocument = CGPDFDocumentCreateWithProvider (provider);


NOTE: Untested code mostly written in Mail!
--
David Duncan
Apple DTS Quartz and Printing
email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: Bilt HIView to Offscreen bitmap (From: Jeff Sparks <email@hidden>)
 >Re: Bilt HIView to Offscreen bitmap (From: Eric Schlegel <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.