• 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: Best Approach in displaying the Image in Core Animation Layer - During the animation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best Approach in displaying the Image in Core Animation Layer - During the animation


  • Subject: Re: Best Approach in displaying the Image in Core Animation Layer - During the animation
  • From: David Duncan <email@hidden>
  • Date: Fri, 4 Feb 2011 08:35:20 -0800

On Feb 3, 2011, at 11:11 PM, Sasikumar JP wrote:

> During the Edit mode(Wiggle Animation), Image in Grid(Layer) is not
> displayed properly.Even though i get 60 FPS during the wiggle
> animation,image edge is not smooth.

On iOS antialiasing doesn't occur between layers, which is why you get the jagged edge (the edgeAntialiasingMask property has no effect). If you want to smooth the edge, you will have to do so yourself by drawing the image into a slightly larger layer (1 pixel border should be enough)

> What is the difference in the following 2 approaches.
> Which is the best approach to display the icon image in layer during
> Animation (Wiggle Animation).
>
> 1. Layer.content
> 2. Override drawLayer method and draw the image using [UIImage drawRect]
> method.


That depends on what exactly you are doing inside of -drawLayer:. If you are just drawing the image to the entire area of the context provided, then you are basically making a (likely unnecessary) copy of the image. If you are doing other drawing than just the image, then thats the difference.

For your specific case, making your layer 2 pixels wider and taller, then drawing the image into the center of that layer (to make a 1 pixel border) will likely give you the effect that you desire, although at the cost of additional rendering time since your layers will no longer be opaque.
--
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

References: 
 >Best Approach in displaying the Image in Core Animation Layer - During the animation (From: Sasikumar JP <email@hidden>)

  • Prev by Date: Re: Read Protected File
  • Next by Date: Re: Best text rendering settings?
  • Previous by thread: Best Approach in displaying the Image in Core Animation Layer - During the animation
  • Next by thread: Read Protected File
  • Index(es):
    • Date
    • Thread