QML loaded png look scrambled in android
-
Hello. I have been developing a QML application that is working quite well on desktop.
In the QML file I have buttons with PNG as faces that load like this :
Button { id: profile_button width: top_bar.height height: top_bar.height anchors.verticalCenter: top_bar.verticalCenter anchors.right: top_bar.right anchors.margins: 10 background: Rectangle { color: "#4272E4" } onClicked: { go_to_options_screen(); } Image{ id: top_bar_logo2 source: "qrc:///images/resources/user-solid-2.png" smooth: true mipmap:true height: parent.height *0.55 width : parent.height *0.55 anchors.margins : 10 anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter fillMode: Image.PreserveAspectFit } }//profile button*/
And they work great on desktop. However when I try to deploy to an android AVD the images load as it is shown bellow at bottom of the image. Completely scrambled. Sometimes they do not load scrambled but the images are exchanged among themselves. Does anyone know anything I should check to discover why this is happening on android?
The log of the AVD has some messages that might be relevant.. or not:
E emuglGLESv2_enc: device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glGenerateMipmap:5324 GL error 0x502 condition [tex && !GLESv2Validation::unsizedFormat(internalformat) && !(GLESv2Validation::colorRenderableFormat(ctx, internalformat) && GLESv2Validation::filterableTexFormat(ctx, internalformat))]
E emuglGLESv2_enc: device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glGenerateMipmap:5324 GL error 0x502 condition [tex && !GLESv2Validation::unsizedFormat(internalformat) && !(GLESv2Validation::colorRenderableFormat(ctx, internalformat) && GLESv2Validation::filterableTexFormat(ctx, internalformat))]Thanks for any information or pointers someone could provide me.
-
Hello. I have been developing a QML application that is working quite well on desktop.
In the QML file I have buttons with PNG as faces that load like this :
Button { id: profile_button width: top_bar.height height: top_bar.height anchors.verticalCenter: top_bar.verticalCenter anchors.right: top_bar.right anchors.margins: 10 background: Rectangle { color: "#4272E4" } onClicked: { go_to_options_screen(); } Image{ id: top_bar_logo2 source: "qrc:///images/resources/user-solid-2.png" smooth: true mipmap:true height: parent.height *0.55 width : parent.height *0.55 anchors.margins : 10 anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter fillMode: Image.PreserveAspectFit } }//profile button*/
And they work great on desktop. However when I try to deploy to an android AVD the images load as it is shown bellow at bottom of the image. Completely scrambled. Sometimes they do not load scrambled but the images are exchanged among themselves. Does anyone know anything I should check to discover why this is happening on android?
The log of the AVD has some messages that might be relevant.. or not:
E emuglGLESv2_enc: device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glGenerateMipmap:5324 GL error 0x502 condition [tex && !GLESv2Validation::unsizedFormat(internalformat) && !(GLESv2Validation::colorRenderableFormat(ctx, internalformat) && GLESv2Validation::filterableTexFormat(ctx, internalformat))]
E emuglGLESv2_enc: device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glGenerateMipmap:5324 GL error 0x502 condition [tex && !GLESv2Validation::unsizedFormat(internalformat) && !(GLESv2Validation::colorRenderableFormat(ctx, internalformat) && GLESv2Validation::filterableTexFormat(ctx, internalformat))]Thanks for any information or pointers someone could provide me.
@TiagoSD have you tried to round the width and height by Math.round()