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: Converting HIPoints to CGPoints/NSPoints in global space?



Are you really dealing with screen coordinates? In general more coordinates you deal with are local view coordinates.

-Shawn

On Feb 12, 2006, at 1:16 PM, Dave MacLachlan wrote:

Sorry...

HIPoints in general are relative to 0,0 in the upper left.
NSPoints (and CGPoints) are relative to 0,0 in the lower left.

so an HIPoint at x,y coordinates is equivalent to an NSPoint at x,displaysheight - y

The question is an easy way of figuring out exactly how high the display height is, especially in the case of multiple monitors.

Currently I'm looping through the displays, but there's got to be a better way of doing it.

Cheers,
Dave

On Feb 11, 2006, at 9:31 AM, Scott Thompson wrote:


On Feb 10, 2006, at 4:50 PM, Dave MacLachlan wrote:

Is there a good way to convert NSPoints to HIPoints and back again safely?

I see HIPointConvert, but there doesn't seem to be a "cocoa" coordinate space. I can write a routine iterating through all the displays, and finding the lowest left hand corner, but was wondering if anyone knew of a better way.

I'm afraid I don't understand your question. NSPoints and HIPoints are both "just points with floating point components".


I presume that you are trying to convert points between two coordinate spaces, but it's not clear exactly which two coordinate spaces you are interested in.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Converting HIPoints to CGPoints/NSPoints in global space? (From: Dave MacLachlan <email@hidden>)
 >Re: Converting HIPoints to CGPoints/NSPoints in global space? (From: Scott Thompson <email@hidden>)
 >Re: Converting HIPoints to CGPoints/NSPoints in global space? (From: Dave MacLachlan <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.