I want resize the shapes draw on context by picking their endpoints. And also rotate it with its endPoints. Can anybody suggest me how can I do this with proper example?
开发者_StackOverflow社区My edited Question.
According to the image I have to rotate and scale the shapes by its Endpoint
when the user touches the Endpoint, you can get the coordinates of the touch in touchesbegan: and the frame and transformation of the image. When you move, you get a new coordinate for the touch in touchesmoved:.
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
self.touchStart = [[touches anyObject] locationInView:viewThatContainsImage];
self.imageStartFrame = image.frame;
self.imageTransformStart = image.transform;
[super touchesBegan:touches withEvent:event];
}
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
CGPoint newTouchPoint = [[touches anyObject] locationInView:viewThatContainsImage];
[super touchesMoved:touches withEvent:event];
}
With the starting frame, starting transformation and the starting point and current point, you can figure out the new size/angle change.
精彩评论