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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to