Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QML->Image showing black rectangle instead of image
Forum Updated to NodeBB v4.3 + New Features

QML->Image showing black rectangle instead of image

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.6k 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.
  • B Offline
    B Offline
    ben80
    wrote on 28 Aug 2014, 22:30 last edited by
    #1

    Hi everyone,

    i already asked this question in the QtPi forum, but i think it's too specific.

    My Problem:
    I use QML->Image to display an image on the raspberry pi.
    Whenever the image dimensions are too big (roughly >~2000pixel in one direction), i see a black rectangle instead of the image.
    When i limit the memory usage by "sourceSize" <~2000 it does work. But i need to work with the original image, not the downscaled one.

    My Code:
    @ Image{
    id:box1
    width: 800; height: 800
    sourceSize.width: 1920 -> works as long as the value is <~2000
    sourceSize.height: 1600
    x: 50; y: 50
    source: "pic1.jpg"
    opacity: 1
    fillMode: Image.PreserveAspectFit
    cache: false
    smooth: true
    }@

    I assigned 256MB memory to the gpu which is much more than the image i want to display (~3000x2000 pixel @24Bit -> ~17MB)

    Questions:

    Do you think it's a memory issue?

    Why are 256MB GPU Memory not enough?

    Any ideas how to debug this problem further?

    *My system: *
    desktop: qt 5.2.1
    raspberry: qt 5.3.0 (but i am not sure if it’s the final or some kind of beta. Is there a way to figure that out?)

    Thanks for all comments,
    Ben

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dheerendra
      Qt Champions 2022
      wrote on 29 Aug 2014, 02:21 last edited by
      #2

      Few inputs from my side. What is the size of the image ? If you don't specify any width and height does it work ? Can you try adding the scrollview for the image ?

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • B Offline
        B Offline
        ben80
        wrote on 29 Aug 2014, 07:02 last edited by
        #3

        bq. What is the size of the image?

        I have different, neither work:
        3264 x 2448
        3456 x 2592

        bq. If you don’t specify any width and height does it work ?

        You mean, without sourceSize.width and sourceSize.height?
        That doesn't work either

        bq. Can you try adding the scrollview for the image ?

        I didn't try that. What benefit would i have?

        Ben

        1 Reply Last reply
        0

        1/3

        28 Aug 2014, 22:30

        • Login

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