任何人都可以在此代码中看到允许其在iPhone上使用黄油柔软的东西,但是iPad和retina和非ipad上的缓慢和斑点/厚块?有关如何加速iPad的任何想法?我只是希望它的手指油漆基本上,有超过画笔大小,不透明度和边缘控制(这就是为什么我有梯度,软边)在iPad上绘图的速度很慢,但iPhone是完美的
谢谢
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
CGPoint currentPointTemp = [touch locationInView:parentView.view];
CGPoint currentPoint = CGPointMake((currentPointTemp.x /imageScale)+ (posOffset.x/imageScale), (currentPointTemp.y /imageScale) + (posOffset.y/imageScale));
currentPoint.y -= 10;
UIGraphicsBeginImageContextWithOptions(CGSizeMake(drawImage.frame.size.width, drawImage.frame.size.height), NO, 0);
[drawImage.image drawInRect:CGRectMake(0, 0, drawImage.frame.size.width, drawImage.frame.size.height)];
CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
CGContextSetAlpha(UIGraphicsGetCurrentContext(), opacity);
CGContextBeginPath (UIGraphicsGetCurrentContext());
CGContextAddArc(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y, glamzyDelegate.brushSize, 0, 6.28318531, 0);
CGContextClosePath (UIGraphicsGetCurrentContext());
CGContextClip(UIGraphicsGetCurrentContext());
CGPoint myStartPoint, myEndPoint;
CGFloat myStartRadius, myEndRadius;
myStartPoint.x = lastPoint.x;
myStartPoint.y = lastPoint.y;
myEndPoint.x = lastPoint.x;
myEndPoint.y = lastPoint.y;
myStartRadius = 0;
myEndRadius = glamzyDelegate.brushSize;
CGContextDrawRadialGradient(UIGraphicsGetCurrentContext(), gradient, myStartPoint, myStartRadius, myEndPoint, myEndRadius, kCGGradientDrawsAfterEndLocation);
drawImage.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
lastPoint = currentPoint;
}
这是一个有趣的问题
那就是有趣的事情。在iPad模拟器上,它也很流畅。 iPad和iPhone模拟器流畅,iPhone设备,iPod touch也顺畅。 iPad设备,不那么热,多斑点和缓慢。如果你真的感兴趣,你可以下载应用程序。这段代码运行在Glamzy中,它有一个适用于iPhone和iPad的免费版本。我认为这可能是一个视网膜问题,但在iPad 2上听到这个报道(我只有视网膜iPad)它可能会降低到一个更好的方式来做一个渐变或软边刷。感谢您的关注! –