Iphone 通过手势旋转同一图像后,CoreGraphics擦除图像时出现问题?

Iphone 通过手势旋转同一图像后,CoreGraphics擦除图像时出现问题?,iphone,objective-c,image,core-graphics,uigesturerecognizer,Iphone,Objective C,Image,Core Graphics,Uigesturerecognizer,目前,我遇到了一个有点危险的问题。我所做的是在核心图形的帮助下擦除图像,并在同一图像上应用旋转效果。当我刚擦除图像时,擦除工作准确,但当我先旋转图像,然后擦除同一图像时。当我移动以擦除图像的任何特定像素时,图像变得模糊,图像的高度降低。下面是我用来擦除图像的代码片段:- - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[event allTouches] an

目前,我遇到了一个有点危险的问题。我所做的是在核心图形的帮助下擦除图像,并在同一图像上应用旋转效果。当我刚擦除图像时,擦除工作准确,但当我先旋转图像,然后擦除同一图像时。当我移动以擦除图像的任何特定像素时,图像变得模糊,图像的高度降低。下面是我用来擦除图像的代码片段:-

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
        UITouch *touch = [[event allTouches] anyObject];
        mPreviousPoints = [touch locationInView:self];
        mPreviousPoints.y = mPreviousPoints.y ;
}

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{

        UITouch *touch = [[event allTouches] anyObject];
        CGPoint currentPoint = [touch locationInView:self];
        currentPoint.y = currentPoint.y ;

        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
        UIGraphicsBeginImageContext(self.frame.size);
        CGContextRef currentContext = UIGraphicsGetCurrentContext();
        [self.image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
        CGContextSetBlendMode(currentContext,kCGBlendModeClear);
        CGContextSetLineCap(currentContext, kCGLineCapRound);
        CGContextSetLineWidth(currentContext, 20);
        CGContextSetStrokeColorWithColor(currentContext, [[UIColor clearColor] CGColor]);
        CGContextBeginPath(currentContext);
        CGContextMoveToPoint(currentContext, mPreviousPoints.x , mPreviousPoints.y );
        CGContextAddLineToPoint(currentContext, currentPoint.x , currentPoint.y);
        CGContextStrokePath(currentContext) ;
        self.image = UIGraphicsGetImageFromCurrentImageContext();
        UIGraphicsEndImageContext();
}
如果我不旋转图像,代码工作正常

我也尝试使用触摸事件旋转图像,但没有改变,因此下面是我在应用程序中使用的滚动代码:-

#pragma mark Rotation Gesture

- (void)rotateImage:(UIRotationGestureRecognizer *)recognizer
{
if (objAppDelegate.touchBool == YES)
{
    if([recognizer state] == UIGestureRecognizerStateEnded)
    {
        previousRotation = 0.0;
        return;
    }

    CGFloat newRotation = 0.0 - (previousRotation - [recognizer rotation]);

    CGAffineTransform currentTransformation = touchImageView.transform;
    CGAffineTransform newTransform = CGAffineTransformRotate(currentTransformation, newRotation);

    touchImageView.transform = newTransform;

    previousRotation = [recognizer rotation];
}
}
我正在发布截图,以便您能够正确理解我的问题。所以,请看一下并帮助我

如果可以的话,请帮助我

提前感谢:)