Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / January 2005



Tip: Looking for answers? Try searching our database.

Creation of  printer context

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
midhunc - 27 Jan 2005 16:34 GMT
Is CGContextRef and CGrafPtr are the same?? I do found that in
PMSessionGetGraphicsContext API. If i am deriving a printer context,
can
I use setport to set the drawing port to this port??
Miro Jurisic - 28 Jan 2005 00:41 GMT
> Is CGContextRef and CGrafPtr are the same??

No. Look at QDBegin/EndCGContext

meeroh

Signature

If this message helped you, consider buying an item
from my wish list: <http://web.meeroh.org/wishlist>

Mike Kluev - 28 Jan 2005 18:30 GMT
> Is CGContextRef and CGrafPtr are the same?? I do found that in
> PMSessionGetGraphicsContext API. If i am deriving a printer context,
> can
> I use setport to set the drawing port to this port??

They are not the same. The full story is here:

http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingMana
ger_Ref/cpmref_reference/function_group_6.html#//apple_ref/doc/c_ref/PMSessi
onSetDocumentFormatGeneration

<<<<<
On return, a reference to the current graphics context. The graphics context
returned is the one last set by a call to the function
PMSessionSetDocumentFormatGeneration or the default (QuickDraw) if there was
no call to the function. This reference must be typecast to an appropriate
structure (such as a grafPtr) by the caller.

You should call this function for each page you draw for a print job. After
each call to the function PMSessionBeginPage your application should call
PMSessionGetGraphicsContext to obtain the current graphics context. If that
context is a QuickDraw context, then set the drawing port to this port by
calling the QuickDraw SetPort function. See the discussion of the function
PMSessionBeginPage for more information.

In Mac OS 8 and 9 applications are limited to a QuickDraw context, so
PMSessionGetGraphicsContext returns a grafPtr. In Mac OS X, the graphics
context returned to you is the one last set by a call to the function
PMSessionSetDocumentFormatGeneration.

Signature

Mike Kluev

PS. Remove "-DELETE-." part of my e-mail address to reply.

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.