ios - 奥林巴斯相机套件 : How to avoid the rotation of live view?

标签 ios olympus-camerakit

我宁愿不旋转实时取景图像,即使相机像示例源代码 ImageCaptureSample 那样旋转。可能吗?

最佳答案

您可以在 LiveViewController 中找到 camera:didUpdateLiveView:metadata: 方法。相机套件通过此方法发送带有相机方向标签的应用元数据。 ImageCaptureSample 使用 OLYCameraConvertDataToImage 实用程序中的元数据转换坐标系。每当相机旋转到任何方向时,为什么不将方向标签覆盖为“1”?希望一切顺利。

这是一个示例代码:

- (void)camera:(OLYCamera *)camera didUpdateLiveView:(NSData *)data metadata:(NSDictionary *)metadata
{
    NSMutableDictionary *tmpMetadata = [NSMutableDictionary dictionaryWithDictionary:metadata];
    // 1 means orientation is 0 degree.
    tmpMetadata[@"Orientation"] = @"1";
    UIImage *image = OLYCameraConvertDataToImage(data, tmpMetadata);
    // UIImage *image = OLYCameraConvertDataToImage(data, metadata);

    self.imageView.image = nil;
    self.imageView.image = image;
}

关于ios - 奥林巴斯相机套件 : How to avoid the rotation of live view?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31914053/

相关文章:

ios - 奥林巴斯相机套件 : App exits when it draws face detection frame on the live view

ios - 奥林巴斯相机套件 : Cannot update exposure compensation value soon after

ios - 奥林巴斯相机套件 : Need to acquire captured image in the original size after shooting

ios - 在数组中查找具有相同颜色的元素,如果它们彼此相邻则打印 true

ios - 静态库 - 复制文件目标

ios - NSLocationAlwaysUsageDescription/NSLocationWhenInUseUsageDescription : where to put translations

android - 使用移动浏览器(Unity webgl)时如何强制横向模式?

ios - 如何从最新到最旧的顺序获取图像到 Collection View