- Where Developers Learn, Share, & Build Careers
Problem: Can I crop an image at a fixed coordinate (50,50,200,200) after zoom? I pass several hours and look at the similar question. But the answer is not answered
thanks
The logic of my crop is here ..
CGSE Item Item = CGSIMMake (200, 200); UIGFIFENESS Bizinetzisten (items, NO, 0); CGRTP Choiceant = CGRactMake (50, 50, 200, 200); [ImageView1.image drawInRect: imageRect]; UIImage * newImage = UIGraphicsGetImageFromCurrentImageContext (); UIGraphicsEndImageContext (); But I can not crop the exact image into the scroll view. I want the crop image that is displayed in the scrollview after zoom.
Answer to my own question: After a googling I found a link and After doing a little modification it works fine for me.
It may be that he saved another time and effort. Thanks
UIGraphicsBeginImageContext (CGSizeMake (200, 200)); [ScrollView.layer renderInContext: UIGraphicsGetCurrentContext ()]; UIImage * fullScreenshot = UIGraphicsGetImageFromCurrentImageContext (); UIGraphicsEndImageContext (); ImageView1.contentMode = UIViewContentModeScaleAspectFill; UIImageWriteToSavedPhotosAlbum (full screenshot, zero, zero, zero); Full return screenshots; import quartzakor / quartzakor h if in warning
UIGraphicsGetimageFrenchIngageContax ();
Comments
Post a Comment