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
Contributor
dpcanada
Posts: 32
Registered: ‎04-19-2012
My Device: Z10, Q10, Playbook
My Carrier: Virgin

Bring pic from PhotoEditor into imageView

[ Edited ]

I was able to connect the native PhotoEditor to filepicker...but once I am done editing my pic...I hit save and it does not show up in my imageView...filepicker works great when using the imagecropEnabled signal but the crop ratio is only 4:3 and I would like to have the editor start in filters rather than crop...so I would rather call the native PhotoEditor instead of using the imageCropEnabled signal....

 

Here is my code...It works perfectly until I want to bring it back into my imageView container...hitting save does nothing.

 

FilePicker {
                id: picker1
                title: qsTr("Select a Picture")
                property string selectedFile
                mode: FilePickerMode.Picker
                type: FileType.Picture
                directories: [ "/accounts/1000/shared" ]
                viewMode: FilePickerViewMode.GridView
                sortBy: FilePickerSortFlag.Date
                sortOrder: FilePickerSortOrder.Descending
                //imageCropEnabled: true
                onFileSelected: {
                    selectedFile = selectedFiles[0]
                    var filePath = selectedFile
                    _app.getPhotoEditor(filePath);
                    imgView1.imageSource = selectedFile
                    imgView1.visible = true
                    imgView1.scaleX = 1
                    imgView1.scaleY = 1
                    imgView1.rotationZ = 0
                   
                }
            }

 

 

Here is my App.cpp file too.

 

void App::getPhotoEditor(const QString fileName)
        {
                
            bb::system::InvokeManager manager;
            bb::system::InvokeRequest request;

 

            request.setUri(QUrl::fromLocalFile(fileName));
            request.setTarget("sys.pictureeditor.cardeditor");
            request.setAction("bb.action.EDIT");
            //cardRequest.setURI("file:///accounts/1000/shared/camera");
            InvokeTargetReply *targetReply = manager.invoke(request);

          manager.setParent(this);

            if (targetReply == NULL) {
                qDebug() << "InvokeTargetReply is NULL: targetReply = " << targetReply;
            } else {
                targetReply->setParent(this);
            }
        }

 

Thank you so much for the amazing support on this site...it is inspirational!!!

Dpcanada

Simplify your Life...
Please use plain text.
New Developer
mossa210
Posts: 27
Registered: ‎08-21-2013
My Device: Q10
My Carrier: *

Re: Bring pic from PhotoEditor into imageView

make sure to add "Shared File" permission to xml-descriptor

Please use plain text.
BlackBerry Development Advisor (Retired)
erahnenfuehrer
Posts: 85
Registered: ‎05-25-2012
My Device: Limited Edition Z10
My Carrier: Bell

Re: Bring pic from PhotoEditor into imageView

Do you connect to the card done signal?

 

Check out the documentation here:

 

https://developer.blackberry.com/native/documentation/cascades/device_platform/invocation/picture_ed...

 

Please use plain text.