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. Image Correction in QML

Image Correction in QML

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 362 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.
  • V Offline
    V Offline
    Vijaykarthikeyan
    wrote on last edited by
    #1

    I have written the code for loading the image(.jpg,.jpeg,.png format) from the filebrowser and display the image using Image compoennt in QML. But,the image that is appearing in the display window of QML is splitted.

    This is the original Image:
    11.jpg

    and this is the image that is being displayed in QML window:

    Screenshot 2024-04-09 121435.png

    and this is my image element coded in QML:

    Image{
            id: image
            width:parent.width
            height:parent.height
            anchors.centerIn: parent
            fillMode: Image.PreserveAspectFit
            property bool counter: false
            visible: true
            source: "image://live/image"
            asynchronous: false
            smooth: true
            cache: false
    }
    

    Some images are correctly appearing but some not..why?How to resolve this image splitting issue

    dheerendraD 1 Reply Last reply
    0
    • V Vijaykarthikeyan

      I have written the code for loading the image(.jpg,.jpeg,.png format) from the filebrowser and display the image using Image compoennt in QML. But,the image that is appearing in the display window of QML is splitted.

      This is the original Image:
      11.jpg

      and this is the image that is being displayed in QML window:

      Screenshot 2024-04-09 121435.png

      and this is my image element coded in QML:

      Image{
              id: image
              width:parent.width
              height:parent.height
              anchors.centerIn: parent
              fillMode: Image.PreserveAspectFit
              property bool counter: false
              visible: true
              source: "image://live/image"
              asynchronous: false
              smooth: true
              cache: false
      }
      

      Some images are correctly appearing but some not..why?How to resolve this image splitting issue

      dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      @Vijaykarthikeyan
      Looks like you are loading the image using QImageLoader.
      Can you load the image with simple code like this ?

      Image {
         source : "water.png"
      }
      

      See how this goes.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      V 1 Reply Last reply
      0
      • dheerendraD dheerendra

        @Vijaykarthikeyan
        Looks like you are loading the image using QImageLoader.
        Can you load the image with simple code like this ?

        Image {
           source : "water.png"
        }
        

        See how this goes.

        V Offline
        V Offline
        Vijaykarthikeyan
        wrote on last edited by Vijaykarthikeyan
        #3

        @dheerendra Thank you, Now I have written like this:

        Image{
                id: opencvImage
                width: 0.99*parent.width
                height:0.99*parent.height
                anchors.centerIn: parent
                fillMode: Image.PreserveAspectFit
                property bool counter: false
                visible: true
                source: "file:///C:/Users/hp/Pictures/11.jpg"
                asynchronous: false
                cache: true
        
            }
        

        and the output is like this:

        Screenshot 2024-04-11 110207.png

        What goes wrong? Actually ,What I have been working is: sending the image path from the file browser in qml to the backend C++ which uses Opencv for image processing the image and send that image using QImage to QML displaying window.. where does it goes wrong if I send from C++ to QML rather than directly displaying it?

        1 Reply Last reply
        0

        • Login

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