Re: UI to allow user to scale and crop image within a circle

2016-02-24 Thread David Duncan
> On Feb 24, 2016, at 3:47 PM, Quincey Morris > wrote: > > On Feb 24, 2016, at 13:44 , Graham Cox > wrote: >> >> However, if you use a clipping path, you can just create this on the fly as >> part

Re: UI to allow user to scale and crop image within a circle

2016-02-24 Thread Quincey Morris
On Feb 24, 2016, at 13:44 , Graham Cox wrote: > > However, if you use a clipping path, you can just create this on the fly as > part of -drawRect: and so it’ll always be correct I don’t recall Charles’s drawing code exactly, but I think this is just part of the

Re: UI to allow user to scale and crop image within a circle

2016-02-24 Thread David Duncan
> On Feb 24, 2016, at 1:44 PM, Graham Cox wrote: > > >> On 24 Feb 2016, at 11:08 PM, Charles Jenkins wrote: >> >> My guess is, you do this by adding a mask layer; but you probably don’t >> redraw the mask in drawRect(), hm? It should never need to

Re: UI to allow user to scale and crop image within a circle

2016-02-24 Thread Graham Cox
> On 24 Feb 2016, at 11:08 PM, Charles Jenkins wrote: > > My guess is, you do this by adding a mask layer; but you probably don’t > redraw the mask in drawRect(), hm? It should never need to be refreshed > unless the bounds change. Can you not just use a clipping path?

Re: UI to allow user to scale and crop image within a circle

2016-02-24 Thread David Duncan
> On Feb 24, 2016, at 4:08 AM, Charles Jenkins wrote: > > Good tip! Thanks, Dave and Quincey. I was pretty sure the problem was > something embarrassingly basic. > > The next step is to redesign the CircleOverlayView to fill its view with > black except for the center of

Re: UI to allow user to scale and crop image within a circle

2016-02-24 Thread Charles Jenkins
Good tip! Thanks, Dave and Quincey. I was pretty sure the problem was something embarrassingly basic. The next step is to redesign the CircleOverlayView to fill its view with black except for the center of the circle. I already learned that filling the view with black and then filling the

Re: UI to allow user to scale and crop image within a circle

2016-02-24 Thread David Duncan
> On Feb 23, 2016, at 7:17 PM, Quincey Morris > wrote: > > On Feb 23, 2016, at 18:50 , Charles Jenkins wrote: >> >> I draw based on the overlay view’s frame, NOT based on the rect that gets >> passed in to drawRect(). I must not

Re: UI to allow user to scale and crop image within a circle

2016-02-23 Thread Quincey Morris
On Feb 23, 2016, at 18:50 , Charles Jenkins wrote: > > I draw based on the overlay view’s frame, NOT based on the rect that gets > passed in to drawRect(). I must not understand what that parameter is for. From the UIView documentation for ‘drawRect’: > The portion of the

Re: UI to allow user to scale and crop image within a circle

2016-02-23 Thread Charles Jenkins
I might’ve solved this. My overlay view works now because I draw based on the overlay view’s frame, NOT based on the rect that gets passed in to drawRect(). I must not understand what that parameter is for. I guess the pinning constraints were working all along, but I just couldn’t tell

Re: UI to allow user to scale and crop image within a circle

2016-02-23 Thread Quincey Morris
On Feb 23, 2016, at 12:32 , Charles Jenkins wrote: > > This is the first time I’ve tried to inject an overlay view into the view > hierarchy, so I’m probably doing it completely wrong or missing something > very basic. I’d suggest you go and watch the WWDC videos about

Re: UI to allow user to scale and crop image within a circle

2016-02-23 Thread Charles Jenkins
Jon: Thanks for that advice. I’ll have a look! Quincey: I start with a screen in the storyboard and its default view I’ll call “superview.” Into the superview I toss a scrollview and a toolbar with Cancel and Crop buttons. I position them with autolayout and wire them up to my Swift view

Re: UI to allow user to scale and crop image within a circle

2016-02-23 Thread Quincey Morris
On Feb 23, 2016, at 04:28 , Charles Jenkins wrote: > > My scrollview containing an imageview seems to work just fine: I can scale > and crop an image with no problem. But I’m having difficulty getting the > desired “crop circle” to hover over the scrollview properly. It’s

Re: UI to allow user to scale and crop image within a circle

2016-02-23 Thread Jonathan Hull
Have you looked at cocoa controls? I am pretty sure I have seen a few open source projects that do this. www.cocoacontrols.com Thanks, Jon > On Feb 23, 2016, at 4:28 AM, Charles Jenkins wrote: > > Still struggling with this… My scrollview

Re: UI to allow user to scale and crop image within a circle

2016-02-23 Thread Charles Jenkins
Still struggling with this… My scrollview containing an imageview seems to work just fine: I can scale and crop an image with no problem. But I’m having difficulty getting the desired “crop circle” to hover over the scrollview properly. When I add it to the main view (not the scrollview) at

UI to allow user to scale and crop image within a circle

2016-02-21 Thread Charles Jenkins
I’m trying to do something that’s so simple, conceptually, that I’m sure there’s a demo program for it, if only I could find the right Google search to locate it. I want to allow iOS users to select an image (either from the camera roll or by taking a photo) and display it in a CIRCLE for