Testing when an UIImage background color has changed
<p>I have a student working on a project where he has a UIImage where he is able to draw a line on the screen. We want to know if you have any idea if he goes back and forth filling the entire screen with lines is there a way to test that every pixel has been covered with the line color? For example if the background is grey and the pen color is blue if he goes back and forth enough the screen will begin to turn blue. We want to test what areas are blue and what areas are still grey. </p>

<hr>

<p>The following segment of code will draw a line on the screen. If I run a loop the whole screen will eventually be filled with lines,criss crossed back and forth, and the screen will have the color of the line pen color.</p>

<pre><code>UIGraphicsBeginImageContext(self.view.frame.size);
[drawImage.image drawInRect:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
CGContextSetLineWidth(UIGraphicsGetCurrentContext(), 5.0); // sets width of pen
CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), 0.0, 0.0, 1.0, 1.0); // controls color
CGContextBeginPath(UIGraphicsGetCurrentContext());
CGContextMoveToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y);
CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), currentPoint.x, currentPoint.y);
CGContextStrokePath(UIGraphicsGetCurrentContext());
drawImage.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
</code></pre>
