Launch Camera from Sketchware App and get image to ImageView

Sketchware introduced Camera component in it's new update, version 3.0.0.

Camera component in Sketchware can be used to launch camera from a Sketchware App and get the captured image to ImageView. To learn how, follow the steps given below.

1. In VIEW area of your sketchware project add an ImageView imageview1 and a Button button1.

Set layout_width and layout_height of ImageView to 300, and choose scale_type of ImageView as FIT_CENTER.

2. In LOGIC area of your sketchware project, add a new Camera component cam.

3. In onButtonClick event use the block
Camera cam take picture.
This will launch the camera to take a picture.

4. Add a new event Camera onPictureTaken. Here use the block
ImageView imageview1 set image from file path filePath.

This will display the captured image in ImageView.

5. Save and run the project. Now if you click the Button, it will open camera, and the captured image will be displayed in ImageView.

Watch this video for more details:


To get code for creating imageview with rounded corners visit here: http://www.sketchwarehelp.com/2017/11/create-imageview-with-rounded-corners.html