如何“旋转图像,仅当它处于纵向模式时(但不是在landScape模式下)”

时间:2012-11-22 06:30:27

标签: iphone objective-c uiimageview uiimage uiimagepickercontroller

在我的 iphone 应用中,我使用图片视图显示放大的图片,从其他视图获取

第一个视图中,显示从imagePicker 中捕获的图像的指定位置, Here images are displayed in correct orientation what we captured

(第二个)详细信息视图中,我有一个大(3x4)图像视图,用于在bigSize中显示捕获的图像 (Here ALSO images are displayed in correct orientation what we captured)

但是

我的要求是我需要在3x4像素比率的图像视图中显示大图像,

对于此

如果landScape模式下的图像以方向显示,

如果处于纵向模式,我们需要将其旋转为横向(90˚)。

如何 rotate image , ONLY IF it is in portrait mode (But not in landScape mode)

1 个答案:

答案 0 :(得分:2)

您需要做的就是根据高度和宽度检查图像的大小。如果图像的高度大于单击图像的宽度,则表示您已在纵向模式下拍摄图像。