Yes, you should be able to do this, but you'll need to pull the pixel's back
from OpenGL (glRead), and put them into a PixMap, and then when doing your
printing code. You should be able to do a CopyBit's call over to current
drawing area (i.e. Your printed page GrafPort), that should work Ok.
I also do remember something that you might have to use PICT drawing, when
needing to printing as well with PixMap's, but my memory if fuzzy on the
precise points, but either of these 2 techniques should work for you.
(On side note you might have do something with ColorSync, if you want to
keep the colors more precise, as MacOS-X does a lot of this automatically
for you, but in 9.x this wasn't the case, but you might not need worry about
this straight off)
Hope it helps,
Thanks
Mark.
> Message: 3
> Date: Sat, 21 May 2005 19:04:42 -0400
> From: Christopher Henrich <email@hidden>
> Subject: Printing an OpenGL image in a Carbon app - can it be done?
> To: email@hidden
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset="us-ascii"
>
> I am trying to develop an OpenGL-based application that will run in
> Classic mode. The reason for this is that I hope to interest
> secondary-school teachers, and many of them, I believe, are hanging on
> to their OS-9 computers.
>
> As I understand it, the best way to write a classic application is to
> use Metrowerks Codewarrior, which is what I have done. I have got the
> application to where it will do most of its jobs in Classic mode, but I
> have not figured out how to print.
>
> Printing OpenGL images on Apple computers requires some tricks. In
> 2002, Troy Stephens wrote (on this list)
>> 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.
>
> I was able to make that work in the Cocoa-based version. But in the
> Carbon-based version, I am getting a blank page.
>
> I have put a simplified app on http://mathinteract.com/OpenGLDemo.dmg.
> The troublesome code is in DemoPane::PrintPanelSelf(). I would welcome
> any suggestions on how to make this work.
>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: not available
> Type: text/enriched
> Size: 1298 bytes
> Desc: not available
> Url :
> http://lists.apple.com/mailman/private/mac-opengl/attachments/20050521/728b131
> e/attachment.bin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden
This email sent to email@hidden