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. [SOLVED]BorderImage misunderstanding
Forum Updated to NodeBB v4.3 + New Features

[SOLVED]BorderImage misunderstanding

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 3 Posters 2.7k 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.
  • I Offline
    I Offline
    ixSci
    wrote on last edited by
    #1

    Hello all,

    I'm trying to understand BorderImage but still have no success. Maybe you will help me?
    I've read documentation and concluded that border property is used to offset part of image to be scaled but practice showed me another behaviour. I'll explain my understanding with an example. Point me when I go wrong way, please.
    Let's start:
    I have an image(33 pixels) when each colour rectangle is (11 pixels). Image: !http://img88.imageshack.us/img88/9276/29486181.png(1)!
    Then I create BorderImage:@BorderImage {
    source: "pictures/test.png"
    width: 100
    height: 100
    border.left: 1;
    }@
    And I expected the purple rectangle will be stretched and all other parts' sizes won't change. But instead I have the purple rectangle cropped and other parts stretched:!http://img203.imageshack.us/img203/469/91208145.png(2)!
    Thus, my understanding is: the border property allow to crop a part of the image and not cropped part will be stretched. But it is totally different from the examples in Qt documentation. Please, help me to understand where I'm wrong.

    P.S. This forum will kill me someday. I didn't manage to wrap my code by those buttons and two @ symbols. Is there a way to use a normal markup like BB codes?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      minimoog77
      wrote on last edited by
      #2

      Pink part should be streched only vertically (region 4), other parts should be streched hor. and vertically (they are in region 5, see documentation).

      I don't why pink part is not fully streched vertically.

      1 Reply Last reply
      0
      • I Offline
        I Offline
        ixSci
        wrote on last edited by
        #3

        But why pink\purple rectangle shouldn't stretch horizontally? Pink rectangle is in the 4 region and as I understood it should stretch too.

        1 Reply Last reply
        0
        • N Offline
          N Offline
          ngocketit
          wrote on last edited by
          #4

          "Regions 4 and 6 are scaled according to verticalTileMode". That's what is said in "documentation":http://doc.qt.nokia.com/4.7-snapshot/qml-borderimage.html

          1 Reply Last reply
          0
          • I Offline
            I Offline
            ixSci
            wrote on last edited by
            #5

            OMG I've got it! Thank you guys! Obviously, it is a good practice to read what is written in documentation carefully instead of imagine own behaviour model as I did :)
            [quote]I don’t why pink part is not fully streched vertically.[/quote]
            It actually did. You may see a pink line at the left side.

            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