简体   繁体   English

无法在qt android中加载图片

[英]Can't load image in qt android

I have an address to my mobile image like /sdcard/DCIM/Camera/1.jpg or /storage/emulated/0/DCIM/Camera/1.jpg 我有一个移动图像的地址,如/sdcard/DCIM/Camera/1.jpg或/storage/emulated/0/DCIM/Camera/1.jpg

I use QFile and QImage for read that 我使用QFile和QImage进行读取

  • when read image with qfile, it can't open that but exist function return true 当用qfile读取图像时,它无法打开但存在的函数返回true
  • qimage also can't load image qimage也无法加载图片
  • I also use file:// before upper addresses but not worked. 我也使用file://在高位地址之前但没有工作。

I use qt 5.8 and api 23(android 6) and i make android manifest file and take permission for read and write to storage. 我使用qt 5.8和api 23(android 6)并且我制作了android清单文件并获取了对存储的读写权限。

Your problem may be related to using too large resolution images. 您的问题可能与使用太大分辨率的图像有关。 If you set the sourceSize property, it scales down youre image to the desired resolution. 如果设置sourceSize属性,它会将图像缩小到所需的分辨率。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM