Search code examples
androidnine-patch

top-left corner pixel must be either opaque white or transparent


I am trying to make an image to 9-patch image.

I converted a.png into a.9.png. However, it shows this error below:

top-left corner pixel must be either opaque white or transparent.

enter image description here

The a.png file, the background is transparent. But the editor of Android Studio seems like it doesn't detect the transparent background but it displays black background instead.

Here is the png file(It's a white image with transparent background):

enter image description here

What should I do?


Solution

  • This happened because of the image tool.

    I used this photopea. And it seems like it can't convert correctly.

    So, I reckon some applications have little flaws.

    I tried with pixlr editor and it worked fine.

    If you have photoshop program, it's the best.