0
시나리오를 파괴하지 않고 부모 컨테이너에 맞게하기 위해 QImage 또는 QML 이미지 크기를 조정하려면 :
나는 다양한 종횡비의 QImage을 포함 QML의 Image 구성 요소를 가지고있다.어떻게 이미지의 가로 세로 비율
코드 :
Window {
id: app_window
visible: true
Rectangle {
id: my_image_view_container
width: app_window.width
height: app_window.height
Image {
id: my_image
// changes at runtime based on the image my app selects
source: "random/path/to/an/image.jpg"
width: sourceSize.width
height: sourceSize.height
scale: Qt.KeepAspectRatio
}
}
}
질문 :
어떻게 그렇게 가로 세로 비율을 방해하지 않고 완전히 my_image_view_container
내부 my_image
에 맞게으로 my_image_view_container
의 width
& height
를 설정합니까?
Exxactly 내가 찾고있는 것. 오래 전이 자산을 알고있었습니다. 이 권리를 설정하기 위해 누락되었습니다. 엄청 고마워 ! –