cgaffinetransform

Rotate view using CGAfffineTransformRotate

I have a circular image which i am trying to rotate so that the yellow and black striped circle stays under the users finger and rotates in both directions. I have this so far: - (void)handleJogShuttle:(UIPanGestureRecognizer *)recognizer { UIView *shuttle = [recognizer view]; if ([recognizer state] == UIGestureRecognizerState...

Use PanGestureRecognizer translationInView to track touch location

How would i use a PanGestureRecognizer's translationInView which returns a CGPoint, to track the user touch location so that i can rotate an image so that the point where the user touches stays under the finger? I can use CGAffineTransformRotate to do the rotation but it expects a rotation angle in radians. Currently i am using M_PI/20;...

How to replicate the Scale Up Animation when an app starts regularly (push app icon on HomeScreen) on an iPhone

Hi, i want to replicate the animation when an app starts on iPhone. There is the first view scaling up from 50 % to 100% i think. later I want to use this as a transition between 2 views. Any ideas how to replicate, or is there a ready to use solution from apple in the sdk? Thank you very much :) ...

Creating a Swingometer on the iPhone using Core-Animation

Hi there, I'm trying to create a swingometer, a bit like the ones used in golf games, where the user holds a button to start a swing, releases at the apex to determine power, at which point the 'swing' reverses direction, and the user taps again on the way down to set the accuracy. Rather than having a bar that fills up, I would like ...

Getting the scale factor from a CABasicAnimation

Hi there, I'm animating a shrinking object. At any point the user can hit a button to get the current scale factor of the object. (I start by scaling the object up using a CGAffineTransformMakeScale, so the scale factor should be 1 when it reaches its original size). I'm just not sure how to retrieve the current scale factor from the ani...

dragging objects on the specified path in iphone skd

I defined specified CGPathRef, and i am trying to dragging some objects on this path. I tried several tricks, but couldn't make the required dragging. ...

iphone sdk: CGAffineTransform not working in iOS 4???

hi everyone, i'm using the following code to move a uialertview with a uitextfield in it. The alertView is supposed to slide up when the keyboard appears and slide backdown as soon as it dissappears. The following code worked perfectly fine for me under ios 3.1.2. But for some reason it does not work under ios 4.0..... The issue seems t...

Convert CGPoint between iPhone & CA planes

I have a UIView subclass that I'm drawing a PDF onto (using a CATiledLayer). I also need to draw on a specific region of that PDF, however the coordinate plane of the CATiledLayer when using CG to draw is way screwy. See image: I have a point (200,200), that I need to convert to the CATiledLayer's coordinate system, which is the 2nd ...

How to scale up and crop a UIImage?

Here's the code I have but it's crashing ... any ideas? UIImage *tempImage = [[UIImage alloc] initWithData:imageData]; CGImageRef imgRef = [tempImage CGImage]; [tempImage release]; CGFloat width = CGImageGetWidth(imgRef); CGFloat height = CGImageGetHeight(imgRef); CGRect bounds = CGRectMake(0, 0, width, height); CGSize size = bou...

UIAlertView rotating interface with keyboard visible

I have a UIAlertView that has a text field. So when it shows up the keyboard shows up too. To get the alert view in a better place I set a transformation to it: CGAffineTransform myTransform = CGAffineTransformMakeTranslation(0.0, 180); [alert setTransform:myTransform]; This works fine, as long as the interface orientation does not ch...

Zooming out UIViews (transformation problems)

So I've used CGAffineTransform to zoom in, CGAffineTransform newTrans2 = CGAffineTransformScale(mainView.transform,1.05,1.05); mainView.transform = newTrans2; I do this 15 times to have an animation effect. Now I would like to zoom out such that mainView fits the iPhone frame (0,0,320,480). Besides, the user is able to pinch in and ...

Transform (rotate) a UIBarButtonItem

Hello, Does anybody know how to transform a UIBarButtonItem ? I tried this but with no results :( It's not working on both UIBarButtonItem and its customview. [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:5.0f]; CGAffineTransform myTransform = CGAffineTransformMakeRotation(M_PI_2); UIBarButtonItem * currentI...

Views and buttons unresponsive to touches after rotation

I am coding against iOS 3.0 and I am trying to add rotation (landscape) support to my app. Everything about the rotation was easy enough. However, after rotation to landscape mode from portrait, the right-third of the screen (480-320) is unresponsive to all events (touches, drag, etc.). I've verified that the key window is receiving th...

iOS SDK CGAffineTransform Angle Question

I need to get angle in radians. I have: CGFloat angle = asin(myImage.transform.b); This seems to be not working. I need to extract the angle of 'myImage' at any moment in time. How would I extract this? ...

Rotating a UIImageView greater than 180 degrees in an animation

I'm trying to create an animated meter (like the gas tank in your car). I can't seem to get CGAffineTransformMakeRotate to rotate past 180. I've attempted to do it in 2 separate animations (eg: rotate 180 degrees and then rotate the remaining degrees) but it looks terrible since the timing of the total animation changes frequently on use...