Image Correction in QML
-
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:
and this is the image that is being displayed in QML window:
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
-
@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 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:
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?