9patch transparent image: line showing

I got a transparent 9patch image that has 9patch lines showing the deflection.

This is the result: enter image description here

Obviously, I do not want the horizontal lines to be visible.

This is how I created 9patch:

enter image description here

This is the final image that is used in the application: enter image description here

AFAIK 9patch is correct. What do I need to change so that the horizontal lines disappear?

+4
source share
2 answers

Unwanted lines come from fixed (not stretched) parts of the nine-point overlap. This is because you draw it with a pixel height that is less than the sum of the heights of the fixed sections.

As @kcoppock said above, and then with curiosity removed, the left edge should be solid black, where it stretches vertically.

+6
source

Try to connect two points on the left edge by making a solid line, see if this fixes the problem. To get the exact result, you also need only 1 point at the top.

EDITOR: Ignore the above, I don't know what I was thinking. Connecting the line on the left is definitely not allowed to be my fault.

EDIT: Ignore the above change - Ruben on the right. :)

I don’t know that this caused the problem, but I noticed that there are several pixels on the top edge that are not completely transparent (for example, pixels (5.0) - (28.0)) are very light shade of gray), probably from - due to some bleeding over the smoothing of the form. Try to smooth the image and, of course, erase all external pixels other than black. This should cause a compiler error, but should not cause such an artifact. I'm sorry that I can’t check it myself now, but I can’t.

+1
source

Source: https://habr.com/ru/post/1336953/


All Articles