[Android-development] Fwd: Nine-Patch Images

Filip Piechocki fpiechocki at gmail.com
Tue Mar 19 12:20:58 CET 2013


But on the other hand - maybe it should be really a separate item
(NinePatchImage) - because rather no one would be changing the "ninePatch"
property in run-time (can't imagine such a case) so if someone is decided
to use the nine-patch image (like made with draw9patch) then rather doesn't
need border properties or sci functionality. But it would be nice to hear
the Qt guys opinion.

Best regards,
Filip Piechocki


On Tue, Mar 19, 2013 at 11:20 AM, Filip Piechocki <fpiechocki at gmail.com>wrote:

> Yes, I thought about some boolean property in BorderImage (let's say
> "ninePatch") so when set to true then the BorderImage will read borders
> from the image file (the black stripes in the file output from draw9patch)
> and as a source use and 1 pixel each side shrunk image. I think that the
> 9-patch image format is on one hand something Android-like but on the other
> - it can be used anyware. So I think it would be nice to have it directly
> in QtDeclarative, but I wrote here, as I thought here is the greatest
> chance that someone already considered this. As I need such a functionality
> then I am looking for the best solution - I can make my own Item but it
> would be quite time consuming and duplicating BorderImage once again, as
> the original implementation is "private". So I thought about extending
> BorderImage, but the C++ code is private and uses internal classes so I
> thought it would be nice to get some advice how to make it nice (for now I
> have it almost working) so then maybe push the merge request to Qt repo.
>
> Any thoughts and ideas are appreciated.
>
> Best regards,
> Filip Piechocki
>
>
> On Tue, Mar 19, 2013 at 9:20 AM, Eskil Abrahamsen Blomfeldt <
> eskil.abrahamsen-blomfeldt at digia.com> wrote:
>
>>  On 03/19/2013 09:02 AM, Filip Piechocki wrote:
>>
>> Hi!
>>
>>  I want to ask if there would be BorderImage extension supporting
>> Android's 9-patch images (
>> http://developer.android.com/reference/android/graphics/NinePatch.html ,
>> http://developer.android.com/tools/help/draw9patch.html ) ? I need such
>> functionality so I would like to know if someone already did it maybe in
>> some dev branch, or if not - it would be great to get some guidelines on
>> how to extend BorderImage or maybe it would be better to have another Item
>> (NinePatchImage ? ) supporting 9 patched images? I would love to hear your
>> opinion.
>>
>>
>> Do you mean supporting the output from the draw9patch tool? I think it
>> also makes sense for Qt Creator to have a similar tool that allows
>> designing the nine-patch margins visually.
>>
>> We are, however, considering the idea of having a separate module
>> (Qt5AndroidHelpers or something) which contains support for
>> Android-specific concepts. Having a AndroidBorderImage or something like
>> that in there, which accepts the output from draw9patch and which simply
>> instantiates a BorderImage with the correct margins might be a good idea.
>>
>> -- Eskil
>>
>>
>> _______________________________________________
>> Android-development mailing list
>> Android-development at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/android-development
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/android-development/attachments/20130319/15788e3e/attachment.html>


More information about the Android-development mailing list