• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: CGImageRef printing issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CGImageRef printing issue


  • Subject: Re: CGImageRef printing issue
  • From: David Duncan <email@hidden>
  • Date: Fri, 13 Nov 2009 08:54:43 -0800

On Nov 13, 2009, at 1:27 AM, Mirko Viviani wrote:

> To be honest I didn't remember the resolution indipendent thing, but I was supposing something similar
> since drawing my image in tiles on this context resulted with gaps !
> But I was not able to obtain the scale factor of the printing context so I didn't understand.

Technically you are not drawing to the printer, but rather a specialized PDF context. Getting the current DPI of the printer isn't always possible, and it is easy for the user to invalidate that information (printing to PDF or moving a print job between printers) so it isn't recommended.

> CGContextConvertSizeToDeviceSpace() does not seem to correctly convert my paperSize
> (from NSPrintInfo) to device space. (see below)
> I need this information because I want to scale an image (ie 500 Mpx) to a reasonable size instead of
> crashing my app! :)
>
> I haven't checked the context transform matrix yet, but which route should I follow to obtain this information?


It is doing exactly what it should do given the reality as explained above. I would choose a reasonable scaling factor for your image and use that to resize it before drawing it to the print context.
--
David Duncan
Apple DTS Animation and Printing

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: CGImageRef printing issue (From: Mirko Viviani <email@hidden>)
 >Re: CGImageRef printing issue (From: David Duncan <email@hidden>)
 >Re: CGImageRef printing issue (From: Mirko Viviani <email@hidden>)

  • Prev by Date: NSPredicateEditorRowTemplate and dynamic popups
  • Next by Date: Re: NSTableView and NSTextFieldCell redraw oddness when undo
  • Previous by thread: Re: CGImageRef printing issue
  • Next by thread: Re: CGImageRef printing issue
  • Index(es):
    • Date
    • Thread