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: Help with printing an NSOpenGLView



Hi,

If you want to make your view printing in a more global context (in an other view), you can know in the draRect: method if you are printing and in this case make what is needed to draw the bitmap corresponding of your OpenGL context in place of the sole opengl code

Regards

GI

PS: it would be interesting to have AppKit helping this kind of stuff.

On Friday, December 6, 2002, at 08:39 PM, Troy Stephens wrote:

On Thursday, December 5, 2002, at 03:25 PM, John M Coggi wrote:
Hi. I'm writing a multi-document OpenGL app and would like to allow the user to print the contents of a window. I've scoured the Apple Developer website and all the Cocoa dev sites I know and have found very little pertaining to printing and OpenGL views
in Cocoa. It seems like this would be a common thing for OpenGL applications to do. Geoff, John S., or perhaps someone else on this list, do you have any sample code showing how to print an OpenGL >> view?

The standard AppKit printing mechanism works by simply redirecting Quartz drawing, so printing of OpenGL views isn't automatically supported. What you can do, however, is grab a snapshot of your NSOpenGLView's contents as a bitmap by using glReadPixels() to read from the framebuffer. You can then print the resultant bitmapped image.

Troy Stephens
Cocoa frameworks, Apple
_______________________________________________
mac-opengl mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/mac-opengl
Do not post admin requests to the list. They will be ignored.
_______________________________________________
mac-opengl mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/mac-opengl
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Help with printing an NSOpenGLView (From: Troy Stephens <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.