开发者

What methods can I use to erase the image pixel by pixel?

开发者 https://www.devze.com 2023-03-01 18:40 出处:网络
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));

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号