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. zooming an SVG image

zooming an SVG image

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qmlimagezoomscalememory
1 Posts 1 Posters 729 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.
  • M Offline
    M Offline
    Marc_Van_Daele
    wrote on last edited by
    #1

    Hi,

    An SVG image is scalable and hence, when zooming in, I should still be able to see a crisp sharp image.
    I first tried the following:

    Image {
            id:svgImage
            anchors.fill: parent
            fillMode: Image.PreserveAspectFit
            source: "./pentathlon.svg"
            smooth: false
            scale: 1.0
            transformOrigin: Item.Top
            //sourceSize.height: parent.height*scale
            //sourceSize.width: parent.width*scale
            MouseArea {
                anchors.fill: parent
                onClicked: svgImage.scale *= 2
            }
        }
    

    This scaled fast but after a few clicks, the image was pixelated.
    When uncommenting the two sourceSize lines, the image remained sharp but at the expense of a lot of memory and CPU.

    Is there a way to limit memory usage/CPU consumption without sacrificing sharpness?

    Thanks in advance,

    Marc

    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