Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import bb.cascades 1.0
- import bb.cascades.multimedia 1.0
- Page {
- id: page
- property string status: "waiting"
- titleBar: TitleBar {
- title: root.activeTab.title
- }
- Container {
- Label {
- text: "Status: " + status
- }
- Label {
- id: saveFile
- visible: false
- }
- Container {
- property int padding: 20
- background: Color.create("#fff0f5")
- topPadding: padding
- leftPadding: padding
- rightPadding: padding
- bottomPadding: padding
- Camera {
- id: camera
- property bool photoBeingTaken
- onTouch: {
- console.log('camera touched');
- if (!photoBeingTaken) {
- photoBeingTaken = true;
- camera.capturePhoto();
- }
- }
- onShutterFired: {
- console.log('shutter fired');
- }
- onCameraOpened: {
- console.log('camera opened', camera.supportedCameras);
- camera.startViewfinder();
- page.status = "opened"
- }
- onPhotoSaved: {
- console.log('photo saved', fileName);
- photoBeingTaken = false;
- page.status = "saved";
- saveFile.text = fileName;
- saveFile.visible = true;
- }
- }
- Button {
- text: "Open Camera"
- onClicked: {
- camera.open(CameraUnit.Rear);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement