NinePatch

Class of android.graphics · NinePatch.java · Android's reference

public class NinePatch

A bitmap whose stretchable parts (the divs of its chunk, Res_png_9patch in a device's order) stretch to fill a rectangle, and whose other parts keep their size, as libhwui's nine-patch draws it.

Constructors

public NinePatch(Bitmap bitmap, byte[] chunk) source
public NinePatch(Bitmap bitmap, byte[] chunk, String srcName) source

Methods

public Bitmap getBitmap() source
public int getWidth() source
public int getHeight() source
public void draw(Canvas canvas, RectF location) source
public void draw(Canvas canvas, Rect location) source
public void draw(Canvas canvas, Rect location, Paint paint) source
public static boolean isNinePatchChunk(byte[] chunk) source

As Android's native check: the chunk is long enough and was not marked as not deserialized (-1)


Made from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.