Ich habe diesen Code in Hinblick auf Farbe:IOS: zeichnet ein Bild in einer Ansicht
UITouch *touch = [touches anyObject];
CGPoint currentPoint = [touch locationInView:drawImage];
UIGraphicsBeginImageContext(drawImage.frame.size);
[drawImage.image drawInRect:CGRectMake(0, 0, drawImage.frame.size.width, drawImage.frame.size.height)];
CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
CGContextSetLineWidth(UIGraphicsGetCurrentContext(), size);
CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), r, g, b, a);
CGContextBeginPath(UIGraphicsGetCurrentContext());
CGContextMoveToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y);
CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), currentPoint.x, currentPoint.y);
CGContextStrokePath(UIGraphicsGetCurrentContext());
drawImage.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
mein Problem ist, dass ich nicht mit einem Punkt färben will, aber ich mag ein bestimmtes Bild verwenden, die wird wiederholt (als PNG-Bild) Ist es möglich?
self.view.backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed: @ "image.png"]]; – Hanuman
können Sie bitte erklären? – CrazyDev