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();
Я использую этот код для рисования ...... В касании.проблема в черновой линии
У меня есть пробелы, когда ям рисует быстро ... что делать?
@vdsmedT .... CGPoint currentPoint = [touch previousLocationInView: self.view]; если я использовал это в touchhesMoved, это не изменилось .... – kiran
CGPoint prevPoint = [touch previousLocationInView: self.view]; CGPoint curPoint = [touch locationInView: self.view]; – VdesmedT
@vdsmedT .... Я использовал previouslocationInView тоже ....... все еще я получаю пробелы при рисовании iam. – kiran