Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text drawing using Quartz in an PowerPlant LPane - how to invert y axis?



On May 13, 2005, at 16:46, William Hollingworth wrote:

Code that transforms the Quartz origin to be at the upper-left
 CGContextSaveGState (myContext);
CGContextTranslateCTM (myContext, 0, myOrigin.y + myPortHeight);
CGContextScaleCTM (myContext, 1.0f, -1.0f);
// Your drawing code here.
CGContextRestoreGState (myContext);

Here's my routine for vertically flipping the context for a given rect. Note that it also corrects and returns the rect.


CGRect TransformContextToFlipRect(CGContextRef c, CGRect destBox)
{
    CGContextTranslateCTM(c, 0, CGRectGetMaxY(destBox));
    CGContextScaleCTM(c, 1.0, -1.0);
    destBox = CGRectOffset(destBox, 0, -destBox.origin.y);

    return destBox;
}


_________________________________________________________ Steve Mills Me: 952-401-6255 Senior Software Architect MultiAd email@hidden www.multi-ad.com


_______________________________________________ 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: 
 >Text drawing using Quartz in an PowerPlant LPane - how to invert y axis? (From: William Hollingworth <email@hidden>)



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.