谁能帮我从一个PNG图像创建9片图像? [英] Could anyone help me with creating 9 patch image from a png image?

查看:237
本文介绍了谁能帮我从一个PNG图像创建9片图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建一个聊天application.I想转换我的PNG图像聊天泡成9patch image.I使用此链接....
的http:// Android的UI -utils.google code.com / HG /资产工作室/距离/九patches.html

I am creating a chat application.I want the to convert my png image for chat bubble into a 9patch image.I used this link.... http://android-ui-utils.googlecode.com/hg/asset-studio/dist/nine-patches.html

但问题是,在聊天气泡总是保持一个最小宽度即使为小型报文,对于例如,如果i型像你好时,显示在宽的气泡比message.How得多的文本正确地创建9patch形象??

But the problem is that the chat bubble is always maintaining a minimum width even for small messages.For eg,if i type a text like "hello",it is displayed in a bubble of width much more than the message.How to create 9patch image properly ??

下面是我的PNG图像

推荐答案

您9补丁图像需要比你最小的消息更小。该系统将扩展-9-补丁图像,但绝不会收缩他们在9补丁方式。此外,请确保您的图像文件的名称.9.png结束。

Your 9-patch image needs to be smaller than your smallest message. The system will expand 9-patch images, but will never shrink them in the 9-patch way. Also, make sure the name of your image file ends in ".9.png".

下面是您可以在Android资源工具用于创建的9片图像组编辑的图像:

Here's an edited image that you can use in the Android Asset Tool to create your set of 9-patch images:

下图显示了如何你应该在9补丁生成定义你的伸展地区。你会得到与对补丁图像的压缩文件在几个不同的密度。把这些到您的绘图资源文件夹中。

The following image shows how you should define your stretch regions in the 9-patch generator. You'll get a zip file with p-patch images in a few different densities. Put these into your drawables folders.

这篇关于谁能帮我从一个PNG图像创建9片图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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