| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
I maybe mis-interpreting your case, but you should be able to do this : Assuming the pdf's artbox is artbox (x, y, w, h) and the rectangle you want to draw into is rect (x, y, w, h) CGContextTranslateCTM(rect.x, rect.y); CGContextScaleCTM(rect.w / artbox.w, rect.h / artbox.h); CGContextTranslateCTM(-artbox.x, -artbox.y); To verify this, take the point (artbox.x,artbox.y) and move bottom to top (code wise) applying the transforms and it will map it to point (rect.x, rect.y): Shown for x only: (artbox.x -artbox.x) * (rect.w / artbox.w) + rect.x Similarly the point (artbox.x + artbox.w, artbox.y + artbox.h) multiplied upwards through the transforms should yield (rect.x + rect.w, rect.y + rect.h): for x only : ((artbox.x + artbox.w) - artbox.x) * (rect.w / artbox.w) + rect.x Hope that helps. In general one can use this technique to map an arbitrary rectangle to another rectangle in another space (in the simplified case of translates and scales). __ haroon sheikh هارون شيخ On Mar 31, 2005, at 12:40 PM, David Niemeijer wrote:
|
_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartz-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quartz-dev/email@hidden This email sent to email@hidden
| References: | |
| >CGPDFPageGetDrawingTransform refuses to upscale (From: David Niemeijer <email@hidden>) | |
| >Re: CGPDFPageGetDrawingTransform refuses to upscale (From: Derek Clegg <email@hidden>) | |
| >Re: CGPDFPageGetDrawingTransform refuses to upscale (From: David Niemeijer <email@hidden>) | |
| >Re: CGPDFPageGetDrawingTransform refuses to upscale (From: Derek Clegg <email@hidden>) | |
| >Re: CGPDFPageGetDrawingTransform refuses to upscale (From: David Niemeijer <email@hidden>) | |
| >Re: CGPDFPageGetDrawingTransform refuses to upscale (From: Nick Nallick <email@hidden>) | |
| >Re: CGPDFPageGetDrawingTransform refuses to upscale (From: David Niemeijer <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.