2011-04-28 3 views
1

Je dois créer un jeu pour l'iPhone 3 dans lequel l'image pixel par pixel disparaîtra. J'utiliseQuelles méthodes puis-je utiliser pour effacer l'image pixel par pixel?

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(); 

mais ce code fonctionne lentement sur l'iPhone MB046LL

Quelles méthodes puis-je utiliser pour effacer le pixel d'image par pixel?

+0

formatez votre question ... vous pouvez spécifier le code en utilisant les accolades ..... – lukya

Répondre

0

Une méthode est OpenGL ES. J'ai écrit un jeu et c'était trop lent pour fonctionner sur l'iPhone 3G, j'ai donc dû le réécrire en utilisant Open GL. Ce n'est pas aussi grave que ça en a l'air.

Questions connexes