MDrawing

MDrawing Framework 에 대한 필수 API 를 정의

Drawing API

드로잉 관련 기능을 제공한다.

드로잉 화면 생성

M.drawing.create(setting)

Changed in version 2.0.0.

Arguments
  • setting (Object) – 드로잉을 위한 설정 정보

  • setting.savePoint (String) – 저장 위치 설정 ( Save Point )

  • setting.path (String) – 저장 경로

  • setting.format (String) – 이미지 저장 포맷 ( Format )

  • setting.privacy (Function) – 갤러리에 보여줄지 여부

  • setting.uitype (Function) – 메뉴 위치 정의 ( User Interface Type )

  • setting.orientation (Function) – 화면 오리엔테이션 ( Orientation Type )

  • setting.callback (Function) – 드로잉 결과 반환 콜백 함수

  • 드로잉 화면을 생성한다.

Surrogate Keys: 위 옵션키들과 같은 하위 버전 호환을 위한 대체 옵션 값들
  • alias = path

  • source = path

  • url = path

  • uitype = userInterfaceType

  • orient = orientation

  • orientationtype = orientation

  • done = callback

  • ondone = callback

  • onsave = callback

Example:

M.drawing.create({
        savePoint: 'APPINSIDE',
        format: 'PNG',
        orientation: 'DEFAULT',
        callback: function(status, result) {
                console.log( JSON.stringify( result ) );
        }
});
// 메뉴를 버튼 타입으로 표현
M.drawing.create({
        savePoint: 'APPINSIDE',
        format: 'PNG',
        uitype: 'BUTTON',
        orientation: 'DEFAULT',
        callback: function(status, result) {
                console.log( JSON.stringify( result ) );
        }
});

드로잉 이미지 열기

M.drawing.open(setting)

Changed in version 2.0.0.

Arguments
  • setting (Object) – 이미지 드로잉을 위한 설정 정보

  • setting.savePoint (String) – 저장 위치 설정 ( Save Point )

  • setting.path (String) – 저장 경로

  • setting.format (String) – 이미지 저장 포맷 ( Format )

  • setting.privacy (Function) – 갤러리에 보여줄지 여부

  • setting.uitype (Function) – 메뉴 위치 정의 ( User Interface Type )

  • setting.orientation (Function) – 화면 오리엔테이션 ( Orientation Type )

  • setting.callback (Function) – 드로잉 결과 반환 콜백 함수

  • 드로잉 이미지 화면을 생성한다.

Surrogate Keys: 위 옵션키들과 같은 하위 버전 호환을 위한 대체 옵션 값들
  • alias = path

  • source = path

  • url = path

  • uitype = userInterfaceType

  • orient = orientation

  • orientationtype = orientation

  • done = callback

  • ondone = callback

  • onsave = callback

Example:

M.drawing.open({
        savePoint: 'APPINSIDE',
        format: 'PNG',
        orientation: 'DEFAULT',
        callback: function(status, result) {
                console.log( JSON.stringify( result ) );
        }
});
// 메뉴를 버튼 타입으로 표현
M.drawing.open({
        savePoint: 'APPINSIDE',
        format: 'PNG',
        orientation: 'DEFAULT',
        uitype: 'BUTTON',
        callback: function(status, result) {
                console.log( JSON.stringify( result ) );
        }
});

Save Point

Type

Int

Description

APPINSIDE

0

내부 저장소에 저장

APPOUTSIDE

1

외부 저장소에 저장

Format

Type

Int

Description

PNG

0

PNG 포맷

JPG

1

JPG 포맷

User Interface Type

Type

Int

Description

DEFAULT

0

기본 드로잉 화면

BUTTON

1

버튼 구성 드로잉 화면

Orientation Type

  • 모든 Orientation 값은 Application 설정에 영향을 받음

  • Manifest.xml 에서도 orient 값이 DEFAULT 인 경우 Application 설정의 첫번째 값을 적용

Type

Int

Description

DEFAULT

0

Manifest.xml 에서 설정한 orient 값 적용

PORTRAIT

1

세로모드, 홈버튼이 아래인 세로 방향으로 회전 유지

PORT

1

PORTRAIT 을 축약

LANDSCAPE

2

가로모드, 왼쪽 회전된 상태 유지

LAND

2

LANDSCAPE 를 축약

PORTRAIT|REVERSE

3

세로모드, 세로 방향만 허용, 회전 가능

PORT|REVERSE

3

PORTRAIT 을 축약

PORTREV

3

PORTRAIT|REVERSE 를 축약

LANDSCAPE|REVERSE

4

가로모드, 가로 방향만 허용, 회전 가능

LAND|REVERSE

4

LANDSCAPE 를 축약

LANDREV

4

LANDSCAPE|REVERSE 를 축약

ALL

5

모든 방향으로 허용