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: 16
Registered: ‎06-06-2011
My Device: 8520
My Carrier: developer

how to preview and upload photos after invoke camera

Dear all,

 

need help to preview and upload images after invoke from camera. 

 

I already tried 

void Invoker::childCardDone(const bb::system::CardDoneMessage &message) {
if (!message.data().isEmpty()) {
    this->pictureTaken(QUrl(fileName));
}

or

void Invoker::childCardDone(const bb::system::CardDoneMessage &message) {
if (!message.data().isEmpty()) {
    QString fileName = message.data();
    fileName = QDir::currentPath() + "/shared/camera/"+fileName.mid(fileName.lastIndexOf("/")+1);
    this->pictureTaken(QUrl(fileName));
}

}

 

it only show black image.

 

When i want to upload image

// imageFile
QFile* file = new QFile(imageFile.toString());
bool success = file->open(QIODevice::ReadOnly);
qDebug() << "loadImage << success : " << success;

 fail to open.

 

does anyone have solution for this ? thanks before