Easy custom camera

Easy custom camera

Source code introduction

This is a simple custom camera, LLsimpleCamera control can realize a snapchat-like camera screen, which can easily capture images, handle position and flash, and hide the details related to developers.
Source code running screenshot

Source code snippet

  1. - ( void )snapButtonPressed:(UIButton *)button {
  2. [self.camera capture];
  3. }
  4.   
  5. /* camera delegates */  
  6. - ( void )cameraViewController:(LLSimpleCamera *)cameraVC didCaptureImage:(UIImage *)image {
  7. // we should stop the camera, since we don't need it anymore. We will open a new vc.  
  8. [self.camera stop];
  9.       
  10. ImageViewController *imageVC = [[ImageViewController alloc] initWithImage:image];
  11. [self presentViewController:imageVC animated:NO completion:nil];
  12. }
  13.   
  14. - ( void )cameraViewController:(LLSimpleCamera *)cameraVC didChangeDevice:(AVCaptureDevice *)device {
  15. // device changed, check if flash is available  
  16. if (cameraVC.isFlashAvailable) {
  17. self.flashButton.hidden = NO;
  18. }
  19. else {
  20. self.flashButton.hidden = YES;
  21. }
  22.       
  23. self.flashButton.selected = NO;
  24. }

Source code link: http://download..com/data/1975253

<<:  Wandoujia opens up a new way to discover personalized content

>>:  GuessGame——Guessing Game

Recommend

I have some bad news for you: you may not be suitable for operations!

Continuous self-examination, summarization, and f...

Pork also has health advantages! Eating it right can replenish your nutrition

Many people believe that chicken and beef are hea...

Coughing non-stop, use cough patch? Beware of chemical burns

Audit expert: Peng Guoqiu Deputy Chief Physician,...

Tips and algorithms for creating popular short videos!

01 Changes in the communication model: from manua...

AARRRR model: the underlying logic model of the marketing process!

We have seen too many marketing routines and case...

Practical guide to attracting new customers with Tencent advertising!

1. Advantages of Tencent Trading Site 1. Expandin...

Using iPhone = Protecting the Earth

June 5th of every year is World Environment Day, b...

What are the elements of an effective online product promotion plan?

1. What are the elements of an effective online p...

When increasing user growth, how can we retain new users?

Retention of new users is a very important part o...

How much does it cost to invest in Nanchong’s marriage and love mini program?

How much is the investment cost for Nanchong Marr...