Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Image, loading *.pkm file(ETC1) issue
Forum Updated to NodeBB v4.3 + New Features

Image, loading *.pkm file(ETC1) issue

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
pkmfileimageetc1compression
1 Posts 1 Posters 967 Views 1 Watching
  • 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.
  • D Offline
    D Offline
    divdiv
    wrote on last edited by
    #1

    Hi,
    I'was trying to test the new features from Qt 5.10 and 5.11, and I have a problem with the loading of Image from .pkm file.
    I used for my test a png, I conveted it into pkm(etc1) with Mali Texture Compression Tool (v4.3.0) and I test with to "etc1tool".
    I can encode and decode from each other without any problem. (png->pkm with one and pkm->png with the other one for example).
    So it's seems their is no problem with the generated pkm files.
    But when I trying to load one in the QML with Image, It display a black image with the expected size.
    This is my code to test it :

    import QtQuick 2.11
    import QtQuick.Window 2.11
    
    Window {
        id: window
        visible: true
        width: 1000
        height: 1000
        title: qsTr("Hello World")
        color : "black"
    
        Rectangle{
            color : "darkgray"
            x:0
            y:0
            width:grid.width +20
            height: grid.height + 20
            Grid {
                x:10
                y:10
                id:grid
                columns: 3
    
                horizontalItemAlignment: Grid.AlignHCenter
                verticalItemAlignment: Grid.AlignVCenter
    
                spacing: 10
    
                Text{text : " "; font.pixelSize: 20}
                Text{text : "Normal"; font.pixelSize: 20}
                Text{text : "Pre-alpha"; font.pixelSize: 20}
    
                Text{text : ".png"; font.pixelSize: 20}
                Image { source: "file:///" + applicationDirPath + "/../../imagine_style_test/assets/fuel_gauge/qt_icon.png"; sourceSize.width: 200; sourceSize.height: 200 }
                Image { source: "file:///" + applicationDirPath + "/../../imagine_style_test/assets/fuel_gauge/qt_icon_pre.png"; sourceSize.width: 200; sourceSize.height: 200 }
    
                Text{text : "ETC1 (.pkm)"; font.pixelSize: 20}
                Image { source: "file:///" + applicationDirPath + "/../../imagine_style_test/assets/fuel_gauge/qt_icon.pkm"}
                Image { source: "file:///" + applicationDirPath + "/../../imagine_style_test/assets/fuel_gauge/qt_icon_pre.pkm"}
    
                Text{text : "auto pick"; font.pixelSize: 20}
                Image { source: "file:///" + applicationDirPath + "/../../imagine_style_test/assets/fuel_gauge/qt_icon"}
                Image { source: "file:///" + applicationDirPath + "/../../imagine_style_test/assets/fuel_gauge/qt_icon_pre"}
            }
        }
    }
    

    And finally what is displayed :
    0_1531148945007_problem.png

    I test the compilation under linux and windows(mingw) against Qt 5.10 and 5.11.1 : same results.

    Can someone help me ?
    Thanks

    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