New extension release! Nine Patch Support! - By ColinTree


In the past, when we are using Appinventor or Thunkable, we may meet a problem, that the picture will look ugly after zooming, because the size is no more match what we want

Actually in Android this may happen, but the engineers will not allow this happen for sure.
So that is why nine-patch was created.

One of Android’s most well-known points to consider in application development is the requirement to support a variety of different screen sizes and orientations in an application. The SDK is full of documentation and tools on how to help the developer best accomplish this goal.

The 9-Patch is a PNG image with some coding added that allows the Android system to determine how the image can be stretched and contorted to meet the specific layout constraints during use (like fill_parent and wrap_content). It does this by taking a predefined PNG image, and allowing the user to define a 1-pixel border around the image in locations where stretching can occur.

Now with NinePatchChunk liburary (the author Anatolii published on Github) and the extension by ColinTree, NinePatch is much more easier to be used on Appinventor and Thunkable.


  • SetCompiledNinePatch
  • SetRawNinePatch
  • ** Parameters: **
    • component

      It is usually the last block of a component.
    • path
      sample.9.png - the asset “sample.9.png” that was uploaded


Now here is a compiled picture “menu_dropdown_panel_styled.9.png”
If it is set onto the Button1 by ColinTreeNinepatch, it works well with 9-patch rules
But if the it go through Button1.Image, it still looks horrible.


donate me if you find this is helpful:
this may give me power to continue working!


Create a layout with rounded corners?
The longest list of things to add in Thunkable
Continuum Browser (This project was delayed due to some issues)

Hi Colin Tree! First of all, thank you for your contribution. I’ve have just test your extension( change the picture of your sample aia) . I built an apk, then installed, but it can not run(can not open). this is my pic. So where i was wrong? Thanks!


Works just fine.
Did you compile your 9 patch image, if not use the second block.

this works on android 4.3, 5.0, 7.0 ColinTreeNinePatch_en.apk (2.3 MB)

Btw @ColinTree, good work with this extension.


hello @Manu !
your picture here is a raw nine-patch picture, please use SetRawNinePatch to setup the image

(screenshot ref: @Boban_Stojmenovic)
hope that helps you~


Thank you :joy: