Hi,
I am developping an app which calculates camera lens parameters. It has an area which shows a camera view where user can drag and set camera distance etc. I want to draw a triangle between a fixed point and two others which move when user touches and drags them. I managed to draw this triangle but the problem is that every time user touches or moves the dot a new triangle appears while i only want one. I used the following code:
in touchesMoved:
Thanks in advance
I am developping an app which calculates camera lens parameters. It has an area which shows a camera view where user can drag and set camera distance etc. I want to draw a triangle between a fixed point and two others which move when user touches and drags them. I managed to draw this triangle but the problem is that every time user touches or moves the dot a new triangle appears while i only want one. I used the following code:
in touchesMoved:
Code:
UIGraphicsBeginImageContext(self.view.frame.size);
[drawImage.image drawInRect:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(),0,0,0,1);
CGPoints[CGPointMake(0,100), CGPointMake(location.x,location.y), CGPointMake(location.x,location.y), CGPointMake(newLoc.x,newLoc.y), CGPointMake(newLoc.x,newLoc.y), CGPointMake(0,100)]
//draw is my imageView
draw.image=UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext()
Thanks in advance
Last edited by a moderator: