Details
-
Bug
-
Resolution: Incomplete
-
P3: Somewhat important
-
None
-
5.0.1
Description
I wanted to support Android-like 9-patch images (like those produced with Draw 9-patch: http://developer.android.com/tools/help/draw9patch.html) in BorderImage, so I made such an Item:
Item { property url source clip: true onSourceChanged: { var borders = readBorders(source); // C++ code that analize QImage and returns QVariantMap with borders // set set bi borders } BorderImage { id: bi anchors.fill: parent anchors.margins: -1 } }
The idea is to draw the image 1 pixel lager each side and cut out the "meta-data" border with clip set to true. But it is not working properly. It seems that the borders are also somehow scaled, because sometimes those black lines are visible on the edges like them would be blurred to the "real image" pixels. It works better with smooth set to false, but not always and of course I would like to have the smooth property set to true.
Summarizing:
- it looks like borders, which shouldn't be scaled at least in one direction are somehow scaled or processed
- as a suggestion: as this 9-patch images are widely used in Android the idea is rather platform independent so maybe it should be implemented as BorderImage new functionality (or some new NinePatchImage item if BorderImage is not suitable). With some help and suggestions I would pick up the gauntlet.