core-animation

How do I fade in /out a rectangle or text?

Hi all, I want to achieve the effect of fade in / fade out the rect or text. I call CGContextFillRect or CGContextShowText in my UIVIew's drawRect: method. I wonder if there is a way to achieve the animation without using UIView' support(i.e. [UIView beginAnimations::]. The desired effect I want to achieve is similar to what in Micros...

How do I create a UIImage from a 3d transformed UIImageView layer?

After applying a 3d transform to an UIImageView.layer, I need to save the resulting "view" as a new UIImage... Seemed like a simple task at first :-) but no luck so far, and searching hasn't turned up any clues :-( so I'm hoping someone will be kind enough to point me in the right direction. A very simple iPhone project is available he...

How can I compute the duration for a UIViewAnimationCurveEaseOut animation with a known starting velocity and distance?

I'm animating a view between two points using UIViewAnimationCurveLinear, so I know the velocity of this animation. In certain circumstances I want to append a UIViewAnimationCurveEaseOut to make the view slow to a stop. To make this effect seamless, the ease-out animation must start at the same velocity as the linear animation that pr...

Core Animation: How to make a page flipping transition?

I want to create a page flipping transition for an iPhone app like the one in notes. Basically when you go to a new view the bottom or top of the page curls like if you were turning the page of a book. Anyone know of a tutorial on how to do this? ...

How do I render a view which contains Core Animation layers to a bitmap?

I am using an NSView to host several Core Animation CALayer objects. What I want to be able to do is grab a snapshot of the view's current state as a bitmap image. This is relatively simple with a normal NSView using something like this: void ClearBitmapImageRep(NSBitmapImageRep* bitmap) { unsigned char* bitmapData = [bitmap bitmap...

Using views from other apps as CoreAnimation Layer

All, How can I use (NS)Views from other applications as Layers in my CA app. I.e. I'd like to display a Keynote presentation as Layer in my CA app. I found the iChatTheatre API which looks promising - however I'd need the oposite. An API to get the contents from an app - not to provide it. Any pointers? Thanks. ...

Creating a scrolling counter

I would like to create a scrolling counter and I'm wondering on how to implement this. Should I use for each digit a separate view and animate the view upwards or downwards to create the scrolling effect? Or is there a better way to do this ? ...

Drawing/Rendering a UIView Within a Separate Thread so NSTimer Always Fires Timely

I'm using a NSTimer to fire a drawRect within the app's main view. The drawRect draws a few images, and blends each using kCGBlendModeScreen (which is an absolute must). However, the drawRect takes just a tad longer than desired, so the timer doesn't always get fired at the desired rate (more like half as often). I've optimized the grap...

Animating an NSView in from Below.

How would I animate an NSView in from below. I know there are tutorials like Marcus Zarras which shows how to change from one view to another, but how would I animate in a view which isn't going to replace another view. ...

How Do You CAKeyframeAnimation Scale?

Hi, I want to create an animation with several key frames. I want my Layer (a button in this case) to scale up to 1.5 then down to 0.5 then up to 1.2 then down to 0.8 then 1.0. I also want to EaseIn and EaseOut of each keyframe. As you can imagine, this will create a Springy/Bounce effect on the spot. In other parts of my app I have ...

how to create navigation controller push effect using core animation?

I Am creating an application and i want to achieve push effect but without using navigation controller.Does someone knows a core animation source code to achieve this? I have a view hierarchy like this.A main controller which has an header image with 4 buttons on it.I mean it will be displayed all the time whatever view in front of scree...

iPhone Flip Transition - Can I get notified at the half way point

I have a single UIView for drawing any one of a set of items. That is, my one UIView subclass can be told to draw a square, circle, or triangle for example. I'd like to have a transition to flip that view so that the UIView draws a different shape at the half way point, so it looks like I'm transitioning to a different view, but really ...

Animating removeFromSuperview

I'd like to animate the transition from a subview back to the super view. I display the subview using: [UIView beginAnimations:@"curlup" context:nil]; [UIView setAnimationDelegate:self]; [UIView setAnimationDuration:.5]; [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES]; [self.view addSubview:...

iPhone animate Core Graphics

I have a subclass of UIView that draws a number with a border around it using Core Graphics (unread count style). I have this in a UITableViewCell and change the color of the border when setSelected:animated: is called. The problem is that it does not animate the change. Is there any way on the iPhone to animate the change of Core Graph...

How to fade my Core Animation application to a black screen first like Front Row?

How do I fade my Core Animation application to a fullscreen black screen first like Front Row? ...

CAShapeLayer slowing down interface rotation

Hi, I am trying to move some custom drawing code from a view into a CAShapeLayer, which then get added as a sublayer to the original view's CALayer. This also works well, but when rotating the device, the animation starts to stutter, e.g. you just see the frame in the original orientation and then the final orientation, with at most one...

How to dump CALayer into CGImageRef?

Hello, I have some custom, CoreAnimation based UI. I'd like to implement mouse dragging of certain CALayers and I'd like to stick an image of dragged layer to the cursor. The problem is, that I can't get the CALayer (which isn't image/.contents based) into an image of some kind - like CGImageRef or NSImage. Any ideas? ...

Fast User Switching Hides CALayer

I have an GUI cocoa application that is automatically started when the computer is woken from sleep. The application runs in multiple users accounts at the same time and is sometime launched in a user account that is not the current user being displayed on screen (i.e. the active console user). This is where the problem arises. I have a...

Flatten CALayer sublayers into one layer

In my app I have one root layer, and many images which are sublayers of rootLayer. I'd like to flatten all the sublayers of rootLayer into one layer/image, that don't have any sublayers. I think I should do this by drawing all sublayers in core graphics context, but I don't know how to do that. I hope you'll understand me, and sorry for...

Retrieving sublayers in Core Animation.

Hi there! I am currently developing a small application with Core Animation to get some knowledge about how the framework works. Now I was wondering how I'd be able to perform transformations dynamically on a specific sublayer. I had thought it would be as simple as [somelayer sublayers][0].transform = CATransform3DMake.........;, but it...