Josh Peizer
Josh Peizer

Reputation: 1

LWUIT - How to get a 9 part image to stretch and not repeat (resource editor 1.5)

Is there a way either through code or the Lwuit Recourse Editor to stretch 9 part images to prevent repeating? Ideally I would not want to stretch a single pixel but would not be a huge deal if there was not the choice.

Currently: I have made a few border generated 9 part buttons using the Lwuit Resource Editor. After making the Button I noticed that the areas that should stretch are instead being repeated making my gradients look terrible.

Goal: I am looking to make all my 9 part images (borders, Buttons, etc.) to stretch the Center pieces as references below.

* = Fixed size  
- = Stretched  
| = Image separation  

Current:

* | * | *  
* | * | *  
* | * | *

Want:

* | - | *  
- | - | -  
* | - | * 

Upvotes: 0

Views: 344

Answers (2)

Shai Almog
Shai Almog

Reputation: 52745

LWUIT had the initial work for scaled borders but I never completed it due to the fact that on the fly scaling just isn't supported on J2ME devices. Codename One supports this type of image border but doesn't expose it in the GUI builder both due to complexity and performance.

For most designs you can reach a very similar effect with the traditional 9-piece border when they are created as multi-image components.

Upvotes: 1

Mun0n
Mun0n

Reputation: 4437

You must take a look at this youtube video.

It helped me a lot to build my own borders to my Containers. You can download it from the LWUIT repository. Here you can find this project, and its .res, wich will help you a lot building borders to your Components.

Upvotes: 1

Related Questions