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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to