3
J'ai un CGBitmapContext (bitmapContext) et je voudrais dessiner une partie rectangulaire (rect) de celui-ci à la CGContext actuelle (de contexte).Quartz 2D: tirage au sort d'un CGContext à un autre CGContext
En ce moment je fais de cette façon:
CGContextRef context = UIGraphicsGetCurrentContext();
CGImageRef cgImage = CGBitmapContextCreateImage(bitmapContext);
CGContextClipToRect(context, rect);
CGContextDrawImage(context, CGRectMake(0, 0, width, height), cgImage);
CGImageRelease(cgImage);
est-il optimal? Quelle est la meilleure façon de le faire?