如何创建9补丁在Photoshop?什么是9.png编码? [英] How to create 9 patch in Photoshop? What is 9.png encoding?

查看:156
本文介绍了如何创建9补丁在Photoshop?什么是9.png编码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

提供实用的日子也不好过,比如它不允许做的另存为,或画几个按钮具有类似切片。

Provided utility looks bad, for example it does not allow to do "Save As", or to draw several button states with similar slicing.

是否有可能得出9.png在Photoshop?我注意到,生成PNG只包含黑色像素的外边缘。请问这是什么标志切片?

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?

如果黑点present在两个相反的边缘,如何工作的呢?

What if black pixels present in two opposite edges, how does this work?

是外边缘时,在Android上显示切断?

Are outer edges cut off when displayed on android?

推荐答案

是的,我做的一切我的九个补丁的Photoshop。以下是创建一个9补丁的基本规则:

Yes, I do all of my nine patches in Photoshop. Here are the basic rules for creating a 9-patch:

  1. 外1px的余量可以包含只有黑100%(RGB 0,0,0)或完全透明的。

  1. The outer 1px margin can contain only 100% black (RGB 0, 0, 0) or fully transparent.

的黑象素为顶缘和左边缘限定的拉伸点,并且必须是实线,单点,或两个单独的点。如果两个点被定义,它会伸长同样在两者之间。

The black pixels for the top margin and left margin define the stretch points, and must be either a solid line, a single point, or two separate points. If two points are defined, it will stretch equally between the two.

黑色像素的下边距和右页边距定义内容区域。这些像素必须是一个连续的行。

The black pixels for the bottom margin and right margin define the content area. These pixels must be one contiguous line.

在节能,一定要追加 .9.png 扩展。

When saving, be sure to append the .9.png extension.

希望这有助于。 :)

编辑:是的,这些都不会在你的布局中使用时所显示的,只要它是正确的格式,你已经保存为一个.9.png

And yes, those will not be displayed when used in your layouts, provided it's properly formatted and you've saved it as a .9.png.

好了,上面是一个简单的9补丁的微调。横跨上下在第二图像显示行的行/列的像素将被复制。在第二图像中的蓝色矩形示出了其中机器人将允许被放置内容的区域。所以文字,例如,将简单地包裹住该矩形内。

Okay, so the top would be a simple nine patch for a spinner. the lines across and down in the second image show which rows/columns of pixels would be duplicated. The blue rectangle in the second image shows the area in which Android would allow content to be placed. So text, for example, would simply wrap to stay inside this rectangle.

这篇关于如何创建9补丁在Photoshop?什么是9.png编码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆