j'ai utilisé les codes ci-dessous pour faire pivoter une UIImagefaites pivoter UIImage et rien n'affiche
double angle = -90;
NSData *imageData = [NSData dataWithContentsOfFile:sss];
UIImage *image =[UIImage imageWithData:imageData];
CGSize s = {image.size.width, image.size.height};
UIGraphicsBeginImageContext(s);
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextTranslateCTM(ctx, 0,image.size.height);
CGContextScaleCTM(ctx, 1.0, -1.0);
CGContextRotateCTM(ctx, 2*M_PI*angle/360);
CGContextDrawImage(ctx,CGRectMake(0,0,image.size.width, image.size.height),image.CGImage);
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[myUIImageView setImage:newImage];
mais rien n'affiche sur myUIImageView.
En cas de problème?
Bienvenue tout commentaire
Merci
InterDev
Oui, je veux dessiner une image pivotée dans un rectangle, comment afficher toute l'image pivotée? – arachide
J'ai la solution! Merci – arachide