2010-11-04 13 views
5

क्या आप पर एक परिवर्तन का उपयोग किए बिना UIImage घुमा सकते हैं। मैं एक मानचित्र पर एक कस्टम पिन के रूप में UIImage का उपयोग कर रहा हूं और यदि संभव हो तो इसे घुमा देना चाहूंगा?UIImage घुमाएं?

उत्तर

3

नहीं। केवल एक चीज आप ऐसा करने में सक्षम हो सकता है कि के आधार पर यह तुम्हारे लिए घूर्णन में ओएस coheres को UIImageOrientation स्थापित करने के लिए है - यह है कि केवल आप चार (मुख्य) दे देंगे 90- डिग्री रोटेशन।

+0

लेकिन UIImage :: imageOrientation केवल पढ़ा जाता है! – Martin

0

yess आप बारी बारी से और पूर्वनिर्धारित ImageOrientations में UIImage कर सकते हैं:

UIImage * rotatedImage = [UIImage imageWithCGImage: imageObject.CGImage पैमाने: imageObject.scale उन्मुखीकरण: UIImageOrientationUp];

UIImageOrientationUp, 
UIImageOrientationUpMirrored 
UIImageOrientationDown 
UIImageOrientationDownMirrored 
UIImageOrientationLeft 
UIImageOrientationRight etc 

यह UIImage घूमता है:

यहाँ उन्मुखीकरण पूर्वनिर्धारित enum चर रहा है।