• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: UI to allow user to scale and crop image within a circle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Subject: Re: UI to allow user to scale and crop image within a circle
  • From: Charles Jenkins <email@hidden>
  • Date: Wed, 24 Feb 2016 07:08:04 -0500

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 circle with clearColor() doesn’t work! 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.

Assuming I can figure out how to make a mask layer, what is the correct way to monitor for a bounds change in order to recreate the mask?

-- 

Charles

On February 24, 2016 at 03:16:00, David Duncan (email@hidden) wrote:


> On Feb 23, 2016, at 7:17 PM, Quincey Morris <email@hidden> wrote:
>
> On Feb 23, 2016, at 18:50 , Charles Jenkins <email@hidden> 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 view’s bounds that needs to be updated. The first time your view is drawn, this rectangle is typically the entire visible bounds of your view. However, during subsequent drawing operations, the rectangle may specify only part of your view.
>
>
> So, yes, your code is right now. :)
>

Its almost right – drawing should be done based on the bounds not the frame (this will be an issue if you either use the frame.origin or if you transform the view).

> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden

--
David Duncan

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: UI to allow user to scale and crop image within a circle
      • From: Graham Cox <email@hidden>
    • Re: UI to allow user to scale and crop image within a circle
      • From: David Duncan <email@hidden>
References: 
 >UI to allow user to scale and crop image within a circle (From: Charles Jenkins <email@hidden>)
 >Re: UI to allow user to scale and crop image within a circle (From: Charles Jenkins <email@hidden>)
 >Re: UI to allow user to scale and crop image within a circle (From: Quincey Morris <email@hidden>)
 >Re: UI to allow user to scale and crop image within a circle (From: Charles Jenkins <email@hidden>)
 >Re: UI to allow user to scale and crop image within a circle (From: Quincey Morris <email@hidden>)
 >Re: UI to allow user to scale and crop image within a circle (From: Charles Jenkins <email@hidden>)
 >Re: UI to allow user to scale and crop image within a circle (From: Quincey Morris <email@hidden>)
 >Re: UI to allow user to scale and crop image within a circle (From: David Duncan <email@hidden>)

  • Prev by Date: Re: ARC code in a non ARC app. iOS
  • Next by Date: Re: UI to allow user to scale and crop image within a circle
  • Previous by thread: Re: UI to allow user to scale and crop image within a circle
  • Next by thread: Re: UI to allow user to scale and crop image within a circle
  • Index(es):
    • Date
    • Thread