On 12/nov/2009, at 23.46, David Duncan wrote:
> Just like with all CGContexts you can apply a transform matrix to change the
> coordinate system. However in general this isn't necessary. If you want an
> image to display in a 1" x 1" area on screen, draw it into a 72x72 box. The
> pixel size of the image will determine DPI. If you wanted to draw a 1" image
> at 300 DPI then you would just need a 300x300 image drawn into a 72x72 box.
> If you wanted to draw a 1" image at 600 DPI then you would need a 600x600
> image drawn into the same 72x72 box.
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.
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?
Preview printing view:
paperSize={595.00 842.00} devicePaperSize={212.70 -301.00}
PDF:
paperSize={595.00 842.00} devicePaperSize={595.00 842.00}
Canon printer:
paperSize={595.00 842.00} devicePaperSize={595.00 842.00}
Thank you!
--
Ciao,
Mirko
_______________________________________________
Cocoa-dev mailing list ([email protected])
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 [email protected]