Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Autolib

macrumors newbie
Original poster
Sep 6, 2010
1
0
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.

How can I test when the screen has totally been covered with lines leaving no pixels of the underlying color left.

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();
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.