×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    63

    SVG images scaled in QML

    Hi there,
    I'm using the Text element to display text with images. When I use SVG-T image and try to use scale bigger than in the viewBox declared in the SVG, it scales very poorly (like a bitmap). Here's the HTML-like code I use in Text field

    HTML Code:
    "<img src=\"qrc:/images/some_image.svg\" height=150><br>"
    Krzysztof Kucharewicz

  2. #2
    Nokia Developer Moderator
    Join Date
    Jul 2006
    Location
    Tampere, Finland
    Posts
    13

    Re: SVG images scaled in QML

    I tried the same with the attached SVG, and it seems to render fine. So at least with some SVGs this seems to work ok.

    Code:
        Text {
            text: "<img src=\"arrow.svg\" width=300>"
        }
    Attached Files Attached Files
    Last edited by LateJ; 2011-05-18 at 12:29.
    - Late

  3. #3
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    63

    Re: SVG images scaled in QML

    Your SVG has it's default dimensions way bigger than what you display.
    Downscaling is always more precise than upscaling

    Check my attachment...
    star.zip

    PS. Notice how much you can optimise SVG if you use right settings on export...
    Krzysztof Kucharewicz

  4. #4
    Nokia Developer Moderator
    Join Date
    Jul 2006
    Location
    Tampere, Finland
    Posts
    13

    Re: SVG images scaled in QML

    Oh, true, somehow I got my SVG files mixed up. At least I'm not aware of any solution to this problem, the HTML support in Qt rich text editors is not that extensive, so might be difficult to work around without changing the SVG files themselves.

    Of course using Image {} with sourceSize property set to desired size seems to scale nicely, but apparently that is not a usable solution in this case.
    - Late

Similar Threads

  1. Viewing SVG IMAGES in Emulator
    By HENRYTH20 in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2009-12-18, 18:07
  2. [moved] Editing SVG Images in Nokia 95
    By solidus121 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 4
    Last Post: 2008-12-27, 16:53
  3. Problem in drawing the converted .svg images....
    By pawan_G in forum Symbian Media (Closed)
    Replies: 39
    Last Post: 2008-12-20, 11:44
  4. Scaling svg images in context pane
    By lapetron in forum Symbian User Interface
    Replies: 8
    Last Post: 2007-09-20, 14:51
  5. Scaled Images on Series 40
    By emax73 in forum Mobile Java General
    Replies: 0
    Last Post: 2005-02-28, 13:33

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×