Re: From a view rect to a screen rect

2011-07-02 Thread Development
Ok so the coordinate system is flipped with the CGDisplayCaptureImage method. I thought something like this would invert the y axis for me: y = displayRect.origin.y; selection.origin.y = y - adjusted.y; (Where adjusted y has been changed to correspond with the screen from the preview) Perhap

Re: From a view rect to a screen rect

2011-07-01 Thread Andy Lee
On Jul 1, 2011, at 5:47 PM, Development wrote: > These don't seem to work. The origin is still way way way off > > > NSRect n1=[imageView convertRect:selection toView:nil]; > NSPoint p1 = [window convertBaseToScreen:n1.origin]; > > Does any one know how to take a selected area within

Re: From a view rect to a screen rect

2011-07-01 Thread Andy Lee
On Jul 1, 2011, at 4:52 PM, Lee Ann Rucker wrote: > http://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/6b989dcbb79e9ba/029eeb633c5287cc > > Quote: > If you want to convert to/from the window's base coordinate system, use the > original -convert[xx]:[to|from]View: and

Re: From a view rect to a screen rect

2011-07-01 Thread Development
These don't seem to work. The origin is still way way way off NSRect n1=[imageView convertRect:selection toView:nil]; NSPoint p1 = [window convertBaseToScreen:n1.origin]; Does any one know how to take a selected area within a view and translate it so that it resizes itself and t

Re: From a view rect to a screen rect

2011-07-01 Thread Lee Ann Rucker
On Jul 1, 2011, at 1:14 PM, Andy Lee wrote: > On Jul 1, 2011, at 2:43 PM, Development wrote: >> I have tried having the view itself use convertRectToBase passing the screen >> bounds. > > That method doesn't do what you think it does. The docs say pretty clearly > you should pass it a rect "in

Re: From a view rect to a screen rect

2011-07-01 Thread Andy Lee
On Jul 1, 2011, at 2:43 PM, Development wrote: > I have tried having the view itself use convertRectToBase passing the screen > bounds. That method doesn't do what you think it does. The docs say pretty clearly you should pass it a rect "in the receiver’s coordinate system". This is a method of

Re: From a view rect to a screen rect

2011-07-01 Thread Jeff Kelley
UIView has some convenience methods you can use to convert a CGRect to and from different views’ coordinate systems. Look at the documentation for -convertRect:fromView: