Graphics Reference
In-Depth Information
LISTING 6-11
Continued
NSData * imageData = [image TIFFRepresentation];
CGImageRef imageRef;
if (imageData)
{
CGImageSourceRef imageSource =
CGImageSourceCreateWithData(( CFDataRef )imageData, NULL );
imageRef =
CGImageSourceCreateImageAtIndex(imageSource, 0, NULL );
}
return imageRef;
}
- ( void )dealloc;
{
if ( imageLayer )
[imageLayer release ];
[ super dealloc ];
}
@end
Applying Filters to Transitions
The easiest way to start animating properties with Core Animation is by employing the
animator proxy object on the view you want to animate. When you apply the animator
proxy object, it invokes a number of default transitions that you might or might not
notice. If you set the opacity of a layer, for instance, the transition fades by default. (Fade
in is for increasing the opacity, and fade out is for decreasing it.) To see this default transi-
tion, you call -setOpacity on the animator instead of the view, and the fade transition
will animate automatically with no extra coding effort on your part. The true power of
transitions, though, comes in when you can specify your own transitions, and this is
easily done using filters.
The Default Transitions
Core Animation provides a set of default transitions (see Table 6-2), which you can specify
to use when a property change occurs.
 
 
Search WWH ::




Custom Search