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
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
How to use as linear backgeoind
ReplyDeleteYou can set a PNG image as image initially. Check this, it may help you: https://youtu.be/0uIEaJ99Dw8
DeleteThe link wpnt work i need to set a image to linear mabe with replace image "(image)" whith bitmap photo
ReplyDeletePS i CANT code
PS douwnload my app TextRemaker+
How can I send it to a Firebase DB?
ReplyDeleteh
ReplyDeletehow can i use it .. with another code of open gallery and get image ...its make (duplicate error with ((int.int.int.intent)))
ReplyDeleteon onother open gallery code 😢
How to record video?
ReplyDelete
DeleteI would like to know too
[/storage/emulated/0/.sketchware/libs/com.android.support/support-media-compat/27.0.2/res/layout/notification_template_big_media.xml:23: error: Error: No resource found that matches the given name (at 'layout' with value '@layout/notification_template_icon_group')., , /storage/emulated/0/.sketchware/libs/com.android.support/support-media-compat/27.0.2/res/layout/notification_template_big_media_custom.xml:23: error: Error: No resource found that matches the given name (at 'layout' with value '@layout/notification_template_icon_group')., , /storage/emulated/0/.sketchware/libs/com.android.support/support-media-compat/27.0.2/res/layout/notification_template_media.xml:24: error: Error: No resource found that matches the given name (at 'layout' with value '@layout/notification_template_icon_group')., , /storage/emulated/0/.sketchware/libs/com.android.support/support-media-compat/27.0.2/res/layout/notification_template_media_custom.xml:24: error: Error: No resource found that matches the given name (at 'layout' with value '@layout/notification_template_icon_group')., ]
ReplyDeletewhy error in sketchware 3.9.9