我可以使用哪些方法逐像素地擦除图像?

时间:2011-04-28 07:52:47

标签: iphone image draw

我需要为iPhone 3创建一个游戏,其中逐个像素的图像将消失。我用

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 = UIGraphicsGetImageFromCurrentImageContext ();
UIGraphicsEndImageContext ();

但是此代码在iPhone MB046LL上运行缓慢

我可以使用哪些方法逐像素地擦除图像?

1 个答案:

答案 0 :(得分:0)

一种方法是OpenGL ES。我写了一个游戏,它在iPhone 3G上运行太慢,所以我不得不用Open GL重写它。它没有听起来那么糟糕。

相关问题