开发者

Draw a line by using CAlayer in image in iphone

开发者 https://www.devze.com 2023-04-05 06:38 出处:网络
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).

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

精彩评论

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

关注公众号