开发者

Draw a line by using CAlayer in image in iphone

I am editing my question... what should i do if i want to draw a line in image by using CALAyer.

i want to draw a line inside the circle(circular image).

Example:- One point of the line will be the radius of the lin开发者_StackOverflowe and the other should be the end point of the cirlce(Like analog clock).As the campass of the iphone will move the line should move(like second hand in clock).

Please anyone help me.how to do this

Thanks in advance


Download sourcecode and get idea about how to create analog clock using quartz core.


UIGraphicsBeginImageContext(circleSize);
[chartView.image drawInRect:CGRectMake(0, 0, circleSize.width, circleSize.height)];

// code to draw

chartView.image=UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();   

from this code u can redraw the same picture

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜