2013-07-11 53 views
-1

默認情況下,當我們從ios相冊中獲取圖像時,它總是會被裁剪掉。IOS有沒有一個很好的例子來獲取沒有剪輯的圖片?

而如果我們使用UIImagePickerControllerOriginalImage,那麼它太大了。

(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info 
{ 
    UIImage*temp =[info objectForKey:UIImagePickerControllerEditedImage]; 
} 

是否有任何好的方法來編輯圖像而不削減它的範圍?

+1

得到原始圖像和[調整](http://stackoverflow.com/questions/2658738/the-simplest-way-to它是你自己的? –

回答

0

也許類似的東西...

-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info 
{ 
    UIImage*temp =[info objectForKey: UIImagePickerControllerOriginalImage]; 
    CGSize newSize = CGSizeMake("WIDTH", "HEIGHT"); <---- SET YOUR VALUES 
    UIGraphicsBeginImageContext(newSize); 
    [temp drawInRect:CGRectMake(0,0,newSize.width,newSize.height)]; 
    UIImage* smaller = UIGraphicsGetImageFromCurrentImageContext(); 
    UIGraphicsEndImageContext(); 

}

相關問題