Step 14: Coding the Camera Button

Goal:


Let’s start with programming what happens when we click the PictureButton.

This code will allow our app to access the phone’s camera and take a picture with it.

Steps:

  1. Under the section labeled Blocks select PictureButton.
  2. Grab and place the block labeled “when PictureButton.Click”.
  3. Under Blocks select Camera1.
  4. Grab and place the block labeled “call Camera1.TakePicture”.

Code:


Click to replay