CGContextRef currentContext = UIGraphicsGetCurrentContext();
UIGraphicsBeginImageContext(drawImage.frame.size);
[drawImage.image drawInRect:CGRectMake(0,0, drawImage.frame.size.width, drawImage.frame.size.height)];
CGContextSetRGBStrokeColor(currentContext, 0.0, 0.0, 0.0, 1.0);
UIBezierPath *path=[self pathFromPoint:currentPoint
toPoint:currentPoint];
CGContextBeginPath(currentContext);
CGContextAddPath(currentContext, path.CGPath);
CGContextDrawPath(currentContext, kCGPathFill);
drawImage.image = UIGraphicsGetImageFromCurrentImageContext();
En el código anterior CGContextRef currentContext
creado de UIGraphicsGetCurrentContext()
y pasarlo a CGContextBeginPath CGContextAddPath CGContextDrawPath
CurrentContext tiene parámetro para ellos no su trabajo para mí! Cuando estoy haciendo touchMovie
.UIGraphicsGetCurrentContext value pass a CGContextRef no funciona?
Cuando paso directamente UIGraphicsGetCurrentContext()
en lugar de currentContext
, esto funciona para mí. Quiero saber por qué es así?
@All Por favor, considéreme para este problema.
Por otra parte, usted debe terminar el contexto de imagen cuando no lo necesita más a fin de restablecer la pila gráfico en su estado anterior: 'UIGraphicsEndImageContext();' –
@Sch su trabajo para mí Gracias Sch – kiran
lo encuentro otro problema en esto! No puedo establecer el color en este CGContextSetRGBStrokeColor (currentContext, 1.0, 0.0, 0.0, 1.0); si lo configuro en rojo, ¡sigue dibujando negro! – kiran