Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QML loaded png look scrambled in android

QML loaded png look scrambled in android

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 2 Posters 226 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TiagoSD
    wrote on last edited by
    #1

    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?

    badandroid.png

    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.

    ekkescornerE 1 Reply Last reply
    0
    • T TiagoSD

      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?

      badandroid.png

      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.

      ekkescornerE Offline
      ekkescornerE Offline
      ekkescorner
      Qt Champions 2016
      wrote on last edited by
      #2

      @TiagoSD have you tried to round the width and height by Math.round()

      ekke ... Qt Champion 2016 | 2024 ... mobile business apps
      5.15 --> 6.8 https://t1p.de/ekkeChecklist
      QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved