nine-patch

Different 9-patch images for different densities?

寵の児 提交于 2019-12-03 22:13:49
I have the same 9-patch images in MDPI / HDPI / xhdpi. Is there a particular reason why it will not be saved for the smallest size? The stretchable areas scale automatically when the content is greater, for example a background as a 9-patch. Example background: mdpi: hdpi: xhdpi: Many nine patches are so small that they normally don't need to be recreated for different screen sizes. In your example the corners of the background are not scaled. If you just use the same corners on all resolution they would have a different size on different resolutions. On smaller phones the corners would appear

NinePatchDrawable does not get padding from chunk

谁都会走 提交于 2019-12-03 12:37:17
问题 I need help with NinePatchDrawable: My app can download themes from the network. Almost all things work fine, except 9-Patch PNGs. final Bitmap bubble = getFromTheme("bubble"); if (bubble == null) return null; final byte[] chunk = bubble.getNinePatchChunk(); if (!NinePatch.isNinePatchChunk(chunk)) return null; NinePatchDrawable d = new NinePatchDrawable(getResources(), bubble, chunk, new Rect(), null); v.setBackgroundDrawable(d); d = null; System.gc(); getFromTheme() loads the Bitmap from the

Android: 9-patch repeat pattern instead of stretching

拈花ヽ惹草 提交于 2019-12-03 05:30:12
问题 I have a 9-patch image file which looks like this: When I use it it appears like this: What I actually wanted to achieve is the complete dot in the center repeated instead of stretched . I hope that it's possible. 回答1: I think it's not possible using 9-Patch to make repeated patterns (only stretching certain area), perhaps you could find more about it in official documentation 回答2: ... Correction: If you want the orange dots to repeat, you will not succeed using 9 patch. 9 patch can only

android 9-patch graphic doesn't scale in image view

廉价感情. 提交于 2019-12-03 05:19:52
问题 I have <LinearLayout android:id="@+id/LinearLayout01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <ImageView android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/ImageView01" android:src="@drawable/phone80"></ImageView> <ImageView android:id="@+id/ImageView02" android:layout_height="wrap_content" android:src="@drawable/underline" android:layout_width="fill_parent" android:layout_gravity="fill

How to create 9 patch in Photoshop? What is 9.png encoding? [closed]

主宰稳场 提交于 2019-12-03 05:06:41
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . Provided utility looks bad, for example it does not allow to do "Save As", or to draw several button states with similar slicing. Is it possible to draw 9.png in photoshop? I noticed, that generated png just contains black pixels in outer edge. Is this what is marking the slices? What if black pixels present in

How to create nine-patch and use it in my App?

随声附和 提交于 2019-12-03 05:02:55
问题 I want to create a nine-patch image and use that in my App but I don't know how to create it? I've searched through the Android source code on the Web and I can't seem to find any examples of this. I need a tutorial so that I can understand the process. 回答1: There's a tool included in the android sdk to create and test nine patch images: http://developer.android.com/guide/developing/tools/draw9patch.html You can also create a nine patch file using every gfx package out there ( photoshop,

NinePatchDrawable does not get padding from chunk

喜欢而已 提交于 2019-12-03 03:07:17
I need help with NinePatchDrawable: My app can download themes from the network. Almost all things work fine, except 9-Patch PNGs. final Bitmap bubble = getFromTheme("bubble"); if (bubble == null) return null; final byte[] chunk = bubble.getNinePatchChunk(); if (!NinePatch.isNinePatchChunk(chunk)) return null; NinePatchDrawable d = new NinePatchDrawable(getResources(), bubble, chunk, new Rect(), null); v.setBackgroundDrawable(d); d = null; System.gc(); getFromTheme() loads the Bitmap from the SD card. The 9-Patch PNGs are already compiled, that means they include the required chunk. The way

Android / 9-patch PNG: What, if I need smth like a 11-patch PNG?

混江龙づ霸主 提交于 2019-12-03 01:56:51
In Draw 9-patch, everything looks fine. However , my SDK says the 9-patch png is malformed. Because I have something like an 11-patch png. Because I don't want the little grabbing area to be scaled. How to get it working? The screenshot describes everything: Error Meassage in Console: ERROR: 9-patch image /res/drawable-hdpi/top_complete.9.png malformed. Can't have more than one marked region along edge. Found at pixel #10 along bottom edge. ERROR: Failure processing PNG image /res/drawable-hdpi/top_complete.9.png I believe your issue is that you're splitting the content area into two pieces

How to create nine-patch and use it in my App?

旧时模样 提交于 2019-12-02 19:21:38
I want to create a nine-patch image and use that in my App but I don't know how to create it? I've searched through the Android source code on the Web and I can't seem to find any examples of this. I need a tutorial so that I can understand the process. There's a tool included in the android sdk to create and test nine patch images: http://developer.android.com/guide/developing/tools/draw9patch.html You can also create a nine patch file using every gfx package out there ( photoshop, paint.net, ... ) using the creation guideline here: http://developer.android.com/guide/topics/graphics/2d

Android: 9-patch repeat pattern instead of stretching

我的未来我决定 提交于 2019-12-02 18:48:25
I have a 9-patch image file which looks like this: When I use it it appears like this: What I actually wanted to achieve is the complete dot in the center repeated instead of stretched . I hope that it's possible. Muhammad Abdullah I think it's not possible using 9-Patch to make repeated patterns (only stretching certain area), perhaps you could find more about it in official documentation ... Correction: If you want the orange dots to repeat, you will not succeed using 9 patch. 9 patch can only stretch the part you told it to stretch and leave untouched, the remaining areas. There is no