簡(jiǎn)單的自定義相機(jī)
作者:佚名
這是一個(gè)簡(jiǎn)單的自定義相機(jī),LLsimpleCamera控件可以實(shí)現(xiàn)類似snapchat的相機(jī)屏幕,可以輕松捕捉圖像、處理位置和閃光,并隱藏與開發(fā)者相關(guān)的細(xì)節(jié)。
源碼簡(jiǎn)介
這是一個(gè)簡(jiǎn)單的自定義相機(jī),LLsimpleCamera控件可以實(shí)現(xiàn)類似snapchat的相機(jī)屏幕,可以輕松捕捉圖像、處理位置和閃光,并隱藏與開發(fā)者相關(guān)的細(xì)節(jié)。
源碼運(yùn)行截圖
源碼片段
- - (void)snapButtonPressed:(UIButton *)button {
- [self.camera capture];
- }
- /* camera delegates */
- - (void)cameraViewController:(LLSimpleCamera *)cameraVC didCaptureImage:(UIImage *)image {
- // we should stop the camera, since we don't need it anymore. We will open a new vc.
- [self.camera stop];
- ImageViewController *imageVC = [[ImageViewController alloc] initWithImage:image];
- [self presentViewController:imageVC animated:NO completion:nil];
- }
- - (void)cameraViewController:(LLSimpleCamera *)cameraVC didChangeDevice:(AVCaptureDevice *)device {
- // device changed, check if flash is available
- if(cameraVC.isFlashAvailable) {
- self.flashButton.hidden = NO;
- }
- else {
- self.flashButton.hidden = YES;
- }
- self.flashButton.selected = NO;
- }
責(zé)任編輯:chenqingxiang
來源:
網(wǎng)絡(luò)整理


























