0

我正在尝试以横向模式从相机拍照,我想在iOS6中以纵向模式显示该图像。我无法在纵向模式下旋转图像。

4

1 回答 1

0

你想旋转,那么你要对旋转的图像做什么?
如果您只想在视图中显示它,请将其包装在 中UIImageView,旋转 imageView 并插入到视图中:

-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
    UIImage* image = [[info objectForKey: UIImagePickerControllerOriginalImage] fixOrientation];
    UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
    imageView.transform = CGAffineTransformMakeRotation(M_PI * 90 / 180);
    [self.view addSubview:imageView];
}
于 2013-07-31T10:58:24.100 回答