Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

How to crop an image in IOS by using polygon? How to crop image in after rotate image view in IOS?

I very this two concepts please help me.

user-image
Question ajoutée par Purnachandar Rao Voleti , iOS Developer(software developer) , Aadi Zetta Techsoft (P) Ltd
Date de publication: 2013/08/20
megharaj hothur
par megharaj hothur , Lead Engineer , hcl

You can use a CGImageMask;

 

UIView*rotatedViewBox =[[UIView alloc] initWithFrame:CGRectMake(0.0f,0.0f, inImage.size.width, inImage.size.height)]; rotatedViewBox.transform =CGAffineTransformMakeRotation(inAngle);CGSize rotatedSize = rotatedViewBox.frame.size;UIGraphicsBeginImageContext(rotatedSize);CGContextRef bitmap =UIGraphicsGetCurrentContext();CGContextTranslateCTM(bitmap, rotatedSize.width /2.0f, rotatedSize.height /2.0f);CGContextRotateCTM(bitmap, inAngle);CGContextScaleCTM(bitmap,1.0f,-1.0f);CGContextDrawImage(bitmap,CGRectMake(-inImage.size.width /2.0f,-inImage.size.height /2.0f, inImage.size.width, inImage.size.height), inImage.CGImage);UIImage*resultImage =UIGraphicsGetImageFromCurrentImageContext();UIGraphicsEndImageContext();

Munadel Jaitawi
par Munadel Jaitawi , Senior developer , Lamsa

http://iphonedevsdk.com/forum/iphone-sdk-development/79088-draw-a-polygon-and-fill-with-pattern-image.html       http://stackoverflow.com/questions//rotation-and-cropping-an-image-ios

More Questions Like This

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?