1 / 16

Contents

Contents. 학습목표. Canvas 와 Paint 객체를 통해 화면에 원하는 도형을 그리고 속성을 변경하는 기본적인 방법에 대해 소개한다 . 토스트로 메시지를 출력하는 방법과 스피커를 통해 소리를 출력하는 방법에 대해서도 알아본다 . 학습내용. 캔버스 그리기 객체 쉐이더 그외 출력. 5.3.1. 직선 그래디언트. 셰이더 ( Shader ) : 도형 내부 표면을 채우는 일 셰이더 객체 생성후 Paint 객체의 다음 메서드로 셰이더지정

bendek
Download Presentation

Contents

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Contents 학습목표 • Canvas와 Paint 객체를 통해 화면에 원하는 도형을 그리고 속성을 변경하는 기본적인 방법에 대해 소개한다. • 토스트로 메시지를 출력하는 방법과 스피커를 통해 소리를 출력하는 방법에 대해서도 알아본다. 학습내용 • 캔버스 • 그리기 객체 • 쉐이더 • 그외 출력

  2. 5.3.1. 직선그래디언트 • 셰이더(Shader) : 도형 내부 표면을 채우는 일 • 셰이더 객체 생성후Paint 객체의 다음 메서드로셰이더지정 • ShaderPaint.setShader (Shadershader) • LinearGradient (float x0, float y0, float x1, float y1, int color0, int color1, Shader.TileMode tile) • LinearGradient (float x0, float y0, float x1, float y1, int[] colors, float[] positions, Shader.TileMode tile) • colors배열로 여러 색을 지정하며, positons의 배열은 colors 배열과 크기가 동일해야 하며0~1사이의 값으로 저체길의의 상대적 값을 가진다. null이면 균등한 폭을 가진다.

  3. 5.3.1. 직선그래디언트

  4. 5.3.2. 원형그래디언트 • 원형 그래디언트: 중심에서 시작하여 원 바깥쪽으로 색상 변화 줌 • 직선 그래디언트와 유사하나 두 점 대신 중심점과 반지름 지정 • RadialGradient (float x, float y, float radius, int color0, int color1, Shader.TileMode tile) • RadialGradient (float x, float y, float radius, int[] colors, float[] positions Shader.TileMode tile)

  5. 5.3.2. 원형그래디언트

  6. 5.3.2. 원형그래디언트

  7. 5.3.3. 비트맵 셰이더 • 비트맵 세이더: 비트맵을 무늬로 사용 ( 미리 그려진 그림을 출력하므로 속도 빠름) • BitmapShader (Bitmap bitmap, Shader.TileModetileX, Shader.TileModetileY) • CLAMP 모드는 거의 사용되지 않으며 REPEAT, MIRROR 모드 사용 • 반복해도 경계가 눈에 잘 안띄게 해야 한다.

  8. 5.3.3. 비트맵 셰이더

  9. 5.3.3. 비트맵 셰이더 ComPoseShader (ShadershaderA, ShadershaderB, Xfermode mode) ComPoseShader (ShadershaderA, ShadershaderB, Xfermode mode)

  10. 5.3.3. 비트맵 셰이더

  11. 5.3.4. ShapeDrawable • 드로블(Drawable): 화면에출력될 수 있는 모든것. 이미지, 색상, 셰이더 전체를 포괄한다. 코드로드 생성 가능하지만 디자인 타임에 XML 문서로 미로 생성해 놓을 수도 있다.

  12. 5.3.4. ShapeDrawable 포함

  13. 5.3.2. 원형그래디언트

  14. 5.3.2. 원형그래디언트

  15. 5.3.2. 원형그래디언트

More Related