I tried but the side round shape not shaped properly with 9-patch.
9-patch is a simple png image with 1-pixel borders indicating stretchable area. Read more.
This should solve your purpose.
Related
I want to ninepatch this image.
But when I do and use it, the arrow portion is not visible properly. I have different ways bt still not gettng the sharp arrow.
try this http://romannurik.github.io/AndroidAssetStudio/nine-patches.html
and create nine patch like this so that the pointed portion should not stretch
Then you will get images like this
As It was suggested in one of my questions I have to use 9-patch image with gradient for listview item background.
But when I use 9-patch image, there are still problems with gradients:
9-patch, test.9.png:
But when I left transperent line 1 px height between gradient and bottom 9-patch line, that responds for horizontal content placement it's all ok, and I have good looking gradients.
9-patch image:
And closer to see transperent line:
And it's a result:
I've got good looking gradients, but there are transparent lines, that I don't need. On the image you can see black background behind list because of this line. How to draw 9-patch image in order to have good gradients and don't have "holes" in background?
I'm using actionbarsherlock for fragments.
the Draw9patch images doesn't work well with gradients you will find some diferences displaying it in several Android OS so donĀ“t use it.
Use a GradientDrawable
Changing gradient background colors on Android at runtime
Creating Nine (9) Patch png files with Gradients
I have an ImageView that uses a png of a coin. the png is square and everything outside of the round coin is showing as white in stead of clear. How would I accomplish this?
the corner are not transparent in you png file.
You need to make them transparent beforehand using your favorite image editor, or you can use an online service Here
Is there a way to change color of a ninepatch image(png) programly on android ? I know how do this with bitmap but not with ninepatch...
Thanks to helping me.
Regards
Jim
NinePatch images are standard PNG files, with a 1-pixel border around the outside to mark the repeated areas. You can edit them in any image editor, and as long as you leave the 1-pixel outer border alone, they'll continue to work just fine.
See here for how they are constructed.
I am working with android's 9 patch image emulator to create 9 patch image.
Can anyone tell me how it actually works?
On what basis it Scale the image?
What are the parameters it considers to stretch image?
Here are great paragraphs about 9 patch drawables https://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch
It's basically a PNG image with 1px border around it. With the black pixels on the border you define an area witch is stretchable and area in which the content is allowed.
More information under the link provided by Konstatin.