0
A
回答
1
下面是如何打开手电筒:
AVCaptureSession *session = [[AVCaptureSession alloc] init];
AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:device error: nil];
[session addInput:input];
AVCaptureVideoDataOutput *output = [[AVCaptureVideoDataOutput alloc] init];
[session addOutput:output];
[session beginConfiguration];
[device lockForConfiguration:nil];
[device setTorchMode:AVCaptureTorchModeOn];
[device unlockForConfiguration];
[session commitConfiguration];
[session startRunning];
并再次将其关闭:
[session stopRunning];
你需要与定时打开手电筒和关闭你想要使用类似NSTimer
的东西。
相关问题
- 1. iPhone 4 - 相机闪光灯
- 2. Android相机闪光灯控制
- 3. 问题与相机闪光灯iphone
- 4. Android手动控制相机闪光灯定时
- 5. 机器人和相机闪光灯
- 6. 安卓相机闪光灯不工作
- 7. 相机闪光灯不能从uiimageviewcontroller IOS
- 8. Trigger.io:在相机中禁用闪光灯
- 9. 打开WP7中的相机闪光灯
- 10. Android的 - 使用相机闪光灯
- 11. 相机闪光灯不工作
- 12. Android切换相机闪光灯
- 13. Android相机闪光灯预览
- 14. 像原生相机应用那样执行闪光灯(灯光)
- 15. 如何打开/关闭Swift 2 iPhone相机闪光灯?
- 16. 如何使iPhone相机按钮(变焦,闪光灯,开关)
- 17. 如何开启/关闭iPhone相机闪光灯?
- 18. 控制旋转边框闪光灯AC3
- 19. 遥控闪光灯演示
- 20. 如何在相机闪光灯开启与commonsware相机库
- 21. 录制视频时启用相机闪光灯
- 22. 在Android中使用相机闪光灯闪烁
- 23. 相机闪光灯快速(100Hz或更多)闪烁LED
- 24. LED闪光灯启用后曝光过度的相机图像
- 25. 闪光灯
- 26. 闪光灯
- 27. 在iPhone上点击下的闪光灯
- 28. 是否可以通过编程方式将iPhone的相机闪光灯变暗?
- 29. 当iPhone 4上的闪光灯熄灭时,UIImagePickerController相机会冻结。
- 30. 如何将iPhone 4的相机闪光灯开启(关闭)15x秒
鉴于App Store中有应用程序可以这样做,是的,这完全有可能。 – ceejayoz 2012-03-26 14:20:59
Thx让我知道这是可能的:) – Spire 2012-03-27 08:52:42