What methods can I use to erase the image pixel by pixel?
I need to create a game for the iPhone 3 in which the image pixel by pixel will disappear. I use
UIGraphicsBeginImageContext (CGSizeMake (300.0f, 440.0f));
[MyImage.image drawInRect: CGRectMake (0, 0, 320, 480)];
while (i <4380) {
if (condition) {
CGContextClearRect (UIGraphicsGetCurrentContext (), CGRectMake (x, y, width, height));
}
}
MyImage.image = 开发者_C百科UIGraphicsGetImageFromCurrentImageContext ();
UIGraphicsEndImageContext ();
but this code is running slowly on the iPhone MB046LL
What methods can I use to erase the image pixel by pixel?
One method is OpenGL ES. I wrote a game and it was too slow to run on iPhone 3G so I had to rewrite it using Open GL. It's not as bad as it sounds.
精彩评论