ImageClick Application in iPhone

3

In this application we will see how to image capture in iPhone without using camera. So let see how it will worked.

Step 1: Open the Xcode, Create a new project using View Base application. Give the application “ImageClick”.

Step 2: Xcode automatically creates the directory structure and adds essential frameworks to it. You can explore the directory structure to check out the content of the directory.

Step 3: Expand classes and notice Interface Builder created the ViewController class for you. Expand Resources and notice the template generated a separate nib, ImageClickViewController.xib for the ImageClick application.

Step 4: We need to add one image in the resource in the application. Give the name

Step 5: Open the ImageClickViewController.h file and make the following changes:

 

 

Step 6: Double click the ImageClickViewController.xib file and open it to the interface Builder. Drag the image view and round rect button from the library and place it to the View window. Now select the button and bring up Connection
Inspector and connect Touch Up Inside to the File’s Owner icon and select PhotoCapture: method and select the imageview and bring up Attribute Inspector and select the background image.Now Save the .xib file, close it and go back to the Xcode.

Step 7: Open the ImageClickViewController.m file and make the following changes:

 

 

Step 8: Now Compile and run the application on the Simulator. Click the “Capture Snap” button, it will automatically capture the background image and save it in the photos.

Comments 5

  1. Dear Sir,
    The ImageClick can’t build.
    [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
    This line has a warning:Receiver type ‘CALayer for instance message is a forward declaration.
    How can I change it?
    I think you are still using a very old version of Xcode. Why do you not upgrade it?
    My version is 4.2.1
    Thanks
    Yiu

Leave a Reply

Your email address will not be published. Required fields are marked *