Step 15: Setting the Canvas Background

Goal:


Now that we have the ability to take a picture, we need to do something with the picture we take.

The following code will take the picture we take and set it as the background image of our Canvas.

Steps:

  1. Under the section labeled Blocks select Camera1.
  2. Grab and place the block labeled “when Camera1.AfterPicture”.
  3. Under Blocks select Canvas1.
  4. Grab and place the block labeled “set Canvas1.BackgroundColor”.
  5. Change “BackgroundColor” to say “BackgroundImage”.
  6. On the “when Camera1.AfterPicture” block, hover your mouse over “image”.
  7. Then grab the “get image” block and place it inside the “set Canvas1.BackgroundImage” block.

Code:


Click to replay