Load Image From Device
-
Hi, I want to load photos dynamically from my device (local) to the user interface using JS functions or QML's own features. I opened a post about it before, but I guess no one responded because it was too long or because I explained it complicated. I would be glad if you could help me with this.
-
If you know the directory of photos, you can use Qt.resolved(..) api, convert the directory to url format. Now you should be able to display them.
-
@dheerendra Yes I know the directory. I've never used it before, I'll try it now. Thanks for the suggestion. I hope I can make it.
-
@dheerendra I think I need to add "source: " property in Image.
-
Yes. source property should be set with images you are trying to display.
-
@dheerendra The user may want to upload a different photo from the directory each time. Will it work in this case?
-
@dheerendra
Unfortunately, the method you suggested does not work :( I don't want a single photo to be uploaded from local. User should be able to enter the local folder and select the photo wants from it. -
From the directory you should read the filenames, build the model & then show them in your app.