========== MDrawing ========== MDrawing Framework 에 대한 필수 API 를 정의 ----------- Drawing API ----------- 드로잉 관련 기능을 제공한다. 드로잉 화면 생성 -------------- .. js:function:: M.drawing.create( setting ) .. versionchanged:: 2.0.0 :param Object setting: 드로잉을 위한 설정 정보 :param String setting.savePoint: 저장 위치 설정 ( :ref:`SavePoint` ) :param String setting.path: 저장 경로 :param String setting.format: 이미지 저장 포맷 ( :ref:`Format` ) :param Function setting.privacy: 갤러리에 보여줄지 여부 :param Function setting.uitype: 메뉴 위치 정의 ( :ref:`UserInterfaceType` ) :param Function setting.orientation: 화면 오리엔테이션 ( :ref:`OrientationType` ) :param Function setting.callback: 드로잉 결과 반환 콜백 함수 * 드로잉 화면을 생성한다. Surrogate Keys: 위 옵션키들과 같은 하위 버전 호환을 위한 대체 옵션 값들 * alias = path * source = path * url = path * uitype = userInterfaceType * orient = orientation * orientationtype = orientation * done = callback * ondone = callback * onsave = callback Example: .. code-block:: javascript M.drawing.create({ savePoint: 'APPINSIDE', format: 'PNG', orientation: 'DEFAULT', callback: function(status, result) { console.log( JSON.stringify( result ) ); } }); .. code-block:: javascript // 메뉴를 버튼 타입으로 표현 M.drawing.create({ savePoint: 'APPINSIDE', format: 'PNG', uitype: 'BUTTON', orientation: 'DEFAULT', callback: function(status, result) { console.log( JSON.stringify( result ) ); } }); 드로잉 이미지 열기 -------------- .. js:function:: M.drawing.open( setting ) .. versionchanged:: 2.0.0 :param Object setting: 이미지 드로잉을 위한 설정 정보 :param String setting.savePoint: 저장 위치 설정 ( :ref:`SavePoint` ) :param String setting.path: 저장 경로 :param String setting.format: 이미지 저장 포맷 ( :ref:`Format` ) :param Function setting.privacy: 갤러리에 보여줄지 여부 :param Function setting.uitype: 메뉴 위치 정의 ( :ref:`UserInterfaceType` ) :param Function setting.orientation: 화면 오리엔테이션 ( :ref:`OrientationType` ) :param Function setting.callback: 드로잉 결과 반환 콜백 함수 * 드로잉 이미지 화면을 생성한다. Surrogate Keys: 위 옵션키들과 같은 하위 버전 호환을 위한 대체 옵션 값들 * alias = path * source = path * url = path * uitype = userInterfaceType * orient = orientation * orientationtype = orientation * done = callback * ondone = callback * onsave = callback Example: .. code-block:: javascript M.drawing.open({ savePoint: 'APPINSIDE', format: 'PNG', orientation: 'DEFAULT', callback: function(status, result) { console.log( JSON.stringify( result ) ); } }); .. code-block:: javascript // 메뉴를 버튼 타입으로 표현 M.drawing.open({ savePoint: 'APPINSIDE', format: 'PNG', orientation: 'DEFAULT', uitype: 'BUTTON', callback: function(status, result) { console.log( JSON.stringify( result ) ); } }); .. _SavePoint: Save Point ------------ ============ ===== ============= Type Int Description ============ ===== ============= APPINSIDE 0 내부 저장소에 저장 APPOUTSIDE 1 외부 저장소에 저장 ============ ===== ============= .. _Format: Format ------------ ============ ===== ============= Type Int Description ============ ===== ============= PNG 0 PNG 포맷 JPG 1 JPG 포맷 ============ ===== ============= .. _UserInterfaceType: User Interface Type -------------------- ============ ===== ============= Type Int Description ============ ===== ============= DEFAULT 0 기본 드로잉 화면 BUTTON 1 버튼 구성 드로잉 화면 ============ ===== ============= .. _OrientationType: 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 모든 방향으로 허용 ======================= ===== =============