brushSize=1.0f;
UIGraphicsBeginImageContext(self.view.frame.size);
[drawImage.image drawInRect:CGRectMake(0, 0, drawImage.frame.size.width, drawImage.frame.size.height)]; //originally self.frame.size.width, self.frame.size.height)];
CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapButt); //kCGLineCapSquare, kCGLineCapButt, kCGLineCapRound
CGContextSetLineWidth(UIGraphicsGetCurrentContext(), brushSize);
CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), 1.0, 1.0, 0.0, 1.0);
CGContextMoveToPoint(UIGraphicsGetCurrentContext(), lastPoint.x+brushSize*4,lastPoint.y-brushSize);
CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), lastPoint.x-brushSize, lastPoint.y+brushSize*4);
CGContextStrokePath(UIGraphicsGetCurrentContext());
CGContextFlush(UIGraphicsGetCurrentContext());
drawImage.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
我正在使用此代碼進行繪製......在touchesmoved中。繪製線中的問題
當iam快速繪製時,我確實收到了差距......該怎麼辦?
@vdsmedT .... CGPoint currentPoint = [touch previousLocationInView:self.view];如果我在touchesMoved中使用它,它不會改變.... – kiran 2010-09-21 09:30:48
CGPoint prevPoint = [touch previousLocationInView:self.view]; CGPoint curPoint = [touch locationInView:self.view]; – VdesmedT 2010-09-21 11:35:32
@vdsmedT ....我使用previouslocationInView太.......我仍然得到間隙時,IAM繪圖。 – kiran 2010-09-21 18:55:17