I am using the ninth patch image as a highlighted element of a selector element. An image with nine patches is here:

The image that finally got the visualization is this (screenshot of the emulator and device, both devices have resolutions> mdpi):

As you can see, it was scaled outside the stretchable area (as defined in the 9 patch file), the dark green bar is much thicker, as it should be. Why can this be and can be avoided? The draw9patch tool scales this image correctly. Is this because Android is trying to maintain physical size on high-resolution devices?
source
share