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. Qml image sub region (spritesheet) but with centered image
Qt 6.11 is out! See what's new in the release blog

Qml image sub region (spritesheet) but with centered image

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 1 Posters 980 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.
  • S Offline
    S Offline
    sreich
    wrote on last edited by
    #1

    Is there no qml element that can both let me disable stretching, and let me sample from a subregion of an image?

    Using animatedsprite, but without animation loads it fine how I want it.

    But there is no ability to disable stretching (i want it to be centered).

    And QImage does not have a sub region sampling ability..

    i looked into providing my own image provider..but that seems complex for my needs..i'd prefer not to.

    Software Developer for KDE

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sreich
      wrote on last edited by
      #2

      went image provider route, seems the best/only real way. ( i also needed some resizing code for when the source is larger than the element, to downsize it

      Software Developer for KDE

      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