Kuldeep Singh
Kuldeep Singh

Reputation: 1274

rotating image in quartz 2d

i want to rotate image in quartz 2d around one corner..i want to make analog clock.

Upvotes: 1

Views: 1720

Answers (2)

Vinzius
Vinzius

Reputation: 2901

For example, you could do something like :

CGAffineTransform transform = CGAffineTransformMakeRotation(ANGLE_IN_RADIANS);
view.transform = transform;

And if you want a smoother animation, try using an UIView Animation.

But if you need an other rotation, you should check the documentation :-)

Good Luck !

Upvotes: 1

Greg Sexton
Greg Sexton

Reputation: 9279

You should probably start with the Quartz 2D Programming Guide. In particular, check out the section on transforms, this covers rotation.

Essentially what you need to do is apply a transform matrix for rotation to the Current Transform Matrix (CTM). This defines the mapping of the coordinates that you draw to and the coordinates that are displayed on the user's device.

Quartz does make this all fairly straightforward to do in code; the link above has example code.

Upvotes: 1

Related Questions