-2

i want to draw a line in core graphics in iphone.I am using Quartz for drawing. I want to fix the starting point of the line. How this can be done?

vipul
  • 426
  • 1
  • 5
  • 13

2 Answers2

1

Look for CGContextMoveToPoint in CoreGraphics.

Ilanchezhian
  • 17,426
  • 1
  • 53
  • 55
1

To draw a line just check this How do I draw a line on the iPhone?

And to detect touches and convert them into points do the following.....

- (void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
{
    // Retrieve the touch point

    UITouch *touch=[[event allTouches]anyObject];
    CGPoint point= [touch locationInView:touch.view];

}
Community
  • 1
  • 1
Minakshi
  • 1,437
  • 1
  • 11
  • 19