¡@

Home 

2014/10/15 ¤U¤È 10:05:49

iphone Programming Glossary: currentpath

How To Draw line on touch event?

http://stackoverflow.com/questions/4669490/how-to-draw-line-on-touch-event

assume you have a custom subclass of UIView which has an instance variable paths of type NSMutableArray and a property currentPath of type UIBezierPath . You could then implement the touch detection and drawRect methods roughly like this void touchesBegan.. touch detection and drawRect methods roughly like this void touchesBegan NSSet touches withEvent UIEvent event self.currentPath UIBezierPath bezierPath currentPath.lineWidth 3.0 currentPath moveToPoint touch locationInView self paths addObject self.currentPath.. roughly like this void touchesBegan NSSet touches withEvent UIEvent event self.currentPath UIBezierPath bezierPath currentPath.lineWidth 3.0 currentPath moveToPoint touch locationInView self paths addObject self.currentPath void touchesMoved NSSet..

Drawing on the iPhone in objective c [closed]

http://stackoverflow.com/questions/7397567/drawing-on-the-iphone-in-objective-c

NSSet touches withEvent UIEvent event UITouch touch touches anyObject gestureStartPoint touch locationInView self currentPath moveToPoint gestureStartPoint void touchesMoved NSSet touches withEvent UIEvent event UITouch touch touches anyObject currentPosition.. NSSet touches withEvent UIEvent event UITouch touch touches anyObject currentPosition touch locationInView self currentPath addLineToPoint currentPosition self setNeedsDisplay void drawRect CGRect rect UIColor redColor set currentPath strokeWithBlendMode.. self currentPath addLineToPoint currentPosition self setNeedsDisplay void drawRect CGRect rect UIColor redColor set currentPath strokeWithBlendMode kCGBlendModeNormal alpha 1.0 in the header file declare the following..... CGPoint gestureStartPoint..