如您所知,QtQuick 的图像元素自动支持 HiDPI 图像。例如,它可以@2x
在 iOS 和 MacOS 平台上加载图像。相同的代码在 Android 平台上运行正常。
官方文档中有一节谈到了网络透明性。
但是 Image 元素不会从我的服务器加载 HiDPI 版本的图像。
这是一个错误吗?
如何处理此问题以加载高 dpi 图像?有没有官方推荐的方法?
import QtQuick 2.9
import QtQuick.Window 2.3
import QtQuick.Layouts 1.3
Window {
visible: true
width: 900
height: 520
Image {
id: img
z: 10000
source: "http://127.0.0.1:8080/images/banner-1.jpg" //<-- not loads @2x version automatically
width: 320; height: 205 //<-- also I need to specify a size otherwise it will be so big
}
}
谢谢