Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Highlighted
Contributor
Posts: 13
Registered: ‎01-02-2013
My Device: BB10
My Carrier: BB10

I can't read the picture taked from my devise bb10 alpha despite i can read the same picture from assets

Hi;

i can't read the picture taked from my devise bb10 alpha despite i can read the same picture from assets,thks:smileyhappy:

 

ImageView {
                 id:imag
                 maxHeight: 300
                 minWidth: 300
                 
                 imageSource: "file:///accounts/1000/shared/camera/IMG_00000143.png"
              //   imageSource: "asset:///images/bg.png"
              
            }

Contributor
Posts: 13
Registered: ‎01-02-2013
My Device: BB10
My Carrier: BB10

Re: I can't read the picture taked from my devise bb10 alpha despite i can read the same picture from assets


import bb.cascades 1.0
import bb.cascades.pickers 1.0
 NavigationPane {
            id: navigationPane
Page {
    titleBar: TitleBar {
        title: qsTr("File Picker")
    }
    Container {
        layout: DockLayout {
        }

        // The background image
        ImageView {
            horizontalAlignment: HorizontalAlignment.Fill
            verticalAlignment: VerticalAlignment.Fill
            imageSource: "asset:///images/background.png"
        }
       
        Container {
            horizontalAlignment: HorizontalAlignment.Fill
            verticalAlignment: VerticalAlignment.Fill
            topPadding: 50
            leftPadding: 30
            rightPadding: 30

            //! [0]
            // The file picker mode selector
             Button {
                        text: "click"
                        onClicked: {
                            var newPage = pageDefinition.createObject();
                            navigationPane.push(newPage);
                        }
                        attachedObjects: ComponentDefinition {
                            id: pageDefinition
                            source: "cam.qml"
                        }
                    }
             ImageView {
                 id:imag
                 maxHeight: 300
                 minWidth: 300
                 
                 imageSource: "file:///accounts/1000/shared/camera/IMG_00000143.png"
              //   imageSource: "asset:///images/bg.png"
              
                 
        
                 
                 
             }   
              ContentImage {

                imgSource: "asset:///images/png.png"

              mime: "image/png"
            uri: "file:///accounts/1000/shared/photos/png/sample2.png"
   }

                
       }
    }

}
}

New Contributor
Posts: 6
Registered: ‎01-27-2013
My Device: BB10
My Carrier: Airtel

Re: I can't read the picture taked from my devise bb10 alpha despite i can read the same picture from assets

Hii,

 

I am also facing the same problem. I got the path of image and it also print perfectly but i cant get the image. 

If you get any solution than please reply asap.

 

Thanks in advance.. Smiley Wink

Developer
Posts: 68
Registered: ‎08-16-2012
My Device: BB10 Dev Alpha
My Carrier: NA

Re: I can't read the picture taked from my devise bb10 alpha despite i can read the same picture from assets

If you do not mind, you can reate a custom control, which contains a ImageView, add a imageUrl property. When set the imageUrl, read content from the image file, and set the content to the imageView. It should work.
New Contributor
Posts: 6
Registered: ‎01-27-2013
My Device: BB10
My Carrier: Airtel

Finally got the solution of fetching Image from Gallery

Hello Friends,

I got the solution finally. I used filepicker to pick the image from gallery.

 

string filepath;
ImageView {
id: imageid
}

FilePicker {
            id: filePicker
            type: FileType.Picture
            title: "Select Picture"
            onFileSelected: {
            filepath = selectedFiles[0]
            console.debug("Data in filepath is:", filepath);
            imageid.imageSource = filepath;
            
           }

 try it..