• ios Camera学习笔记


    检测设备的摄像头是否可用:

    - (BOOL) isCameraAvailable{
        return [UIImagePickerController isSourceTypeAvailable:
        UIImagePickerControllerSourceTypeCamera];
    }

    UIImagePickerControllerSourceTypeCamera 检测摄像头功能;

    UIImagePickerControllerSourceTypePhotoLibrary 检测图片库;

    UIImagePickerControllerSourceTypeSavedPhotosAlbum 检测相册功能;

    Media types:在拍照时,用来指定是拍静态的图片还是录像.kUTTypeImage 表示静态图片, kUTTypeMovie表示录像.

    检查相机示例:

    - (BOOL) isFrontCameraAvailable{
    return [UIImagePickerController
    isCameraDeviceAvailable:UIImagePickerControllerCameraDeviceFront];
    }
    - (BOOL) isRearCameraAvailable{
    return [UIImagePickerController
    isCameraDeviceAvailable:UIImagePickerControllerCameraDeviceRear];
    }
    - (BOOL) isFlashAvailableOnFrontCamera{
    return [UIImagePickerController isFlashAvailableForCameraDevice:
    UIImagePickerControllerCameraDeviceFront];
    }- (BOOL) isFlashAvailableOnRearCamera{
    return [UIImagePickerController isFlashAvailableForCameraDevice:
    UIImagePickerControllerCameraDeviceRear];
    }

    其中,检测相机时系统会首先检测摄像头,所以不用再首先检测摄像头。

    详细参考:http://blog.csdn.net/kingsley_cxz/article/details/9157093

  • 相关阅读:
    【AGC010 C】Cleaning
    【未知来源】火神的鱼
    【2017 北京集训 String 改编版】子串
    【未知来源】记忆
    【2017 江苏集训】子串
    【未知来源】循环移位
    【未知来源】K-th String
    【hdu 6067】Big Integer
    【CERC 2014 E】2048
    【hdu 6155】Subsequence Count
  • 原文地址:https://www.cnblogs.com/dokaygang128/p/3494104.html
Copyright © 2020-2023  润新知