Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Save Image in XML file
QtWS25 Last Chance

Save Image in XML file

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 2 Posters 1.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    neda
    wrote on last edited by neda
    #1

    Hi,
    I want to get image from camera and save to XML file.
    I pass "photoPreview.source (== image://camera/preview_1)" as URL of captured image to c++ class.
    I have this error:
    "Open error"
    How can I get URL of captured image by camera? (URL of photoPreview.source)

    QFile fileImg(url_image); // == > photoPreview.source (== image://camera/preview_1)
            fileImg.open(QIODevice::ReadOnly);
            QByteArray imageData = fileImg.readAll();
            QByteArray imageData_Base64 = imageData.toBase64();
            xmlWriter.writeAttribute("image",imageData_Base64);
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You need to use the capturedImagePath in order to get the file corresponding to your captured image.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved