¡@

Home 

2014/10/15 ¤U¤È 10:14:59

iphone Programming Glossary: to.y

Drawing triangle/arrow on a line with CGContext

http://stackoverflow.com/questions/2500197/drawing-triangle-arrow-on-a-line-with-cgcontext

CGPoint from to CGPoint to double slopy cosy siny Arrow size double length 10.0 double width 5.0 slopy atan2 from.y to.y from.x to.x cosy cos slopy siny sin slopy draw a line between the 2 endpoint CGContextMoveToPoint context from.x length.. CGContextMoveToPoint context from.x length cosy from.y length siny CGContextAddLineToPoint context to.x length cosy to.y length siny paints a line along the current path CGContextStrokePath context here is the tough part actually drawing the.. CGContextClosePath context CGContextStrokePath context similarly the the other end CGContextMoveToPoint context to.x to.y CGContextAddLineToPoint context to.x length cosy width 2.0 siny to.y length siny width 2.0 cosy CGContextAddLineToPoint..

How to erase part of an image as the user touches it

http://stackoverflow.com/questions/2978382/how-to-erase-part-of-an-image-as-the-user-touches-it

s CGContextRef g UIGraphicsGetCurrentContext CGContextMoveToPoint g from.x from.y CGContextAddLineToPoint g to.x to.y CGContextClosePath g CGContextAddRect g CGRectMake 0 0 s.width s.height CGContextEOClip g image drawAtPoint CGPointZero..