레이블이 9-Patch인 게시물을 표시합니다. 모든 게시물 표시
레이블이 9-Patch인 게시물을 표시합니다. 모든 게시물 표시

2011년 1월 7일 금요일

[Android Course][English][Theme] - Android's 9-patch (nine patches) drawable definition and production methods




1. Definition
'Android' and 'NinePatch' graphics that will support a bitmap image.
There is a PNG image Stretchable (growing) region can be defined.
9-Patch (NinePatch) images typically view (View) is used as a background image. The actual button 'Default Background' image 9-Patch (NinePatch) is in the image.

In general PNG image types with 1pixel border is composed of. Does not stretch as far as this border area will define the area. 1 pixel black line at the top of the left and can grow to define a portion. May increase the portion can be multiple.

1 pixel black line on the right side and bottom views are what draw the region to decide. In other words, to determine the padding area. If you draw the line at the top of the left and the lines are used. For example, if the text is drawn in the view text is displayed in the sections of this line is drawn.




2. How to make
9-Patch (NinePatch) images in order to make the draw9patch Tools directory of the SDK that contains an image editor. 'draw9patch' tool allows you to easily create.

1)   'draw9patch' tool Path.
: android-sdk-windows\tools\draw9patch.bat
2) 사용법
- 'draw9patch.bat' 실행

- Stretchable Image Setting
: 일반 'Stretchable Image'를 'Stretchable area' Top or Bottom에 설정.





















- 'Android Project' in the use of
: The Image 'fileName.9.png' and 'Android Control' when applied to 'fileName' portion is also available.


In addition, inquiries, or questions, please contact us.
(joonryang@gmail.com)

[Android 강좌][Korean][테마] - Android의 9-patch(나인패치) drawable 정의 및 제작 방법




추가로 문의 사항이나, 궁금한 점이 계시면 연락주세요.
(joonryang@gmail.com)
※ 도움이 되셨다면, ^^. 맨 위 광고클릭 좀..ㅎㅎ

1. 정의'Android'는 'NinePatch' 그래픽이라고 하는 비트맵 이미지를 지원합니다.
PNG 이미지로 되어있는데 Stretchable(늘어나는) 영역을 정의할 수 있습니다.
9-Patch(NinePatch) 이미지는 보통 뷰(View)의 배경이미지로 사용됩니다. 실제 버튼의 'Default Background' 이미지가 9-Patch(NinePatch) 이미지로 되어있습니다.

일반 PNG 이미지에서 1pixel의 보더를 가지는 형태로 구성되어있습니다. 이 보더가 늘어나는 영역과 늘어나지 않는 영역을 정의하게 됩니다. 왼쪽과 위쪽의 1 pixel 검은색 선은 늘어날 수 있는 부분을 정의합니다. 늘어날 수 있는 부분은 여러개가 될 수 있습니다.

오른쪽과 아래쪽의 1 pixel 검은색 선은 뷰가 그려질 영역을 정하는 일을 합니다. 다시 말해 패딩 영역을 결정합니다. 만약 이 선을 그리지 않는다면 왼쪽과 위쪽의 선이 사용됩니다. 예를 들어 텍스트뷰의 경우 그려질 텍스트가 이 선이 그려진 영역안에서 표시됩니다.




2. 제작 방법
9-Patch(NinePatch) 이미지를 쉽게 만들기 위해서 SDK의 Tools디렉토리에 draw9patch라고 하는 이미지 에디터가 들어있습니다. 'draw9patch' tool을 사용하면 쉽게 제작이 가능 합니다.

1)   'draw9patch' tool Path.
: android-sdk-windows\tools\draw9patch.bat
2) 사용법
- 'draw9patch.bat' 실행

- Stretchable Image Setting
: 일반 'Stretchable Image'를 'Stretchable area' Top or Bottom에 설정.





















- 'Android Project'에서 사용법
: 해당 이미지 'fileName.9.png'를 'Android Control'에 적용 시에 'fileName' 부분만을 사용하시면 됩니다.


추가로 문의 사항이나, 궁금한 점이 계시면 연락주세요.
(joonryang@gmail.com)
※ 도움이 되셨다면, ^^. 맨 위 광고클릭 좀..ㅎㅎ