Results 1 to 2 of 2

Thread: Set image for qml camera from c++

  1. #1
    Join Date
    Jan 2016
    Posts
    81
    Thanks
    31
    Qt products
    Qt5
    Platforms
    Windows

    Default Set image for qml camera from c++

    Hi,
    I convert image of camera to base64 string.

    Qt Code:
    1. QFile fileImg(url of image); // == camera.imageCapture.capturedImagePath
    2. fileImg.open(QIODevice::ReadOnly);
    3. QByteArray imageData = fileImg.readAll();
    4. QByteArray imageData_Base64 = imageData.toBase64();
    5. xmlWriter.writeAttribute("image",imageData_Base64);
    To copy to clipboard, switch view to plain text mode 

    I have a string like this:
    /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAA ......

    Now I want show above string as image in qml camera.

    Please guide me.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Set image for qml camera from c++

    If you want to display a string, the primary element of choice would be Text.

    No idea what you mean "in qml camera" though, a Camera element is for showing the data from a camera.
    If you want the text to be on top of the camera image, you can likely use the Text as a child of the Camera.

    Cheers,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    neda (6th March 2016)

Similar Threads

  1. Replies: 3
    Last Post: 3rd February 2016, 17:41
  2. Replies: 0
    Last Post: 14th April 2015, 15:13
  3. Update Live Image from Camera
    By benz6699 in forum Qt Programming
    Replies: 1
    Last Post: 10th July 2014, 09:18
  4. Replies: 0
    Last Post: 12th June 2013, 07:44
  5. Replies: 0
    Last Post: 12th March 2012, 13:54

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.