UIGraphicsBeginImageContext(self.view.bounds.size);
[currentStrokeImageView.image drawInRect:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height)];
CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
CGContextSetBlendMode(UIGraphicsGetCurrentContext(), kCGBlendModeNormal);
CGContextSetLineWidth(UIGraphicsGetCurrentContext(), dWidth);
CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), r, g, b, 1.0f);
CGContextBeginPath(UIGraphicsGetCurrentContext());
CGContextMoveToPoint(UIGraphicsGetCurrentContext(), pointA.x, pointA.y);
CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), pointB.x, pointB.y);
CGContextStrokePath(UIGraphicsGetCurrentContext());
currentStrokeImageView.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
由於某些原因,這款產品在iphone/ipod上絕對沒有延遲,但在iPad上它們在繪製時顯着滯後。我使用的代碼在上面,有任何建議來解決這個問題?Coregraphics在iPad上造成很大的延遲?
這將有助於瞭解上述代碼正在執行的上下文(rimshot!)。 –
你在什麼情況下意味着什麼?當用戶拖動手指時,它位於self.view內,請詳細說明,因爲我不太清楚你的意思(初學者的類型) – Aspyn
這種代碼被調用的方法是什麼? –