ios - Rotate a UIImage -


i'm trying figure out how rotate image of image view , determine direction facing.

i know can rotate uiimageview this

imagview.transform = cgaffinetransformmakerotation(1.57079633); 

uiimage *yourimagehere; switch (imageview.image.imageorientation) {     case uiimageorientationup:         newimage=[uiimage imagewithcgimage:[imageview.image cgimage] scale:1.0f orientation:uiimageorientationleft];         imageview.contentmode=uiviewcontentmodescaleaspectfit;         break;     case uiimageorientationleft:         newimage=[uiimage imagewithcgimage:[imageview.image cgimage] scale:1.0f orientation:uiimageorientationdown];         imageview.contentmode=uiviewcontentmodescaleaspectfill;         break;     case uiimageorientationdown:         newimage=[uiimage imagewithcgimage:[imageview.image cgimage] scale:1.0f orientation:uiimageorientationright];         imageview.contentmode=uiviewcontentmodescaleaspectfit;         break;     case uiimageorientationright:         newimage=[uiimage imagewithcgimage:[imageview.image cgimage] scale:1.0f orientation:uiimageorientationup];         imageview.contentmode=uiviewcontentmodescaleaspectfill;         break;     default:         break; } imageview.image=newimage; 

may helps you


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -