@morpheus/plugin-drawing 라이브러리에서 제공되는 모듈
Before M.drawing.create
새로운 그림판을 생성하여 사용자로부터 그림 입력을 받습니다.
Parameters
options
Object
"APPINSIDE" | "APPOUTSIDE"string"PNG" | "JPG""DEFAULT" | "BUTTON""DEFAULT" | "PORTRAIT" | "PORT" | "LANDSCAPE" | "LAND" | "PORTREV" | "LANDREV" | "ALL"Return
Promise<Object>
"SUCCESS" | "FAIL"stringstringstringstringUsage
import { create } from '@morpheus/plugin-drawing'
create({
savePoint: 'APPINSIDE',
path: 'drawings/sketch1.png',
format: 'PNG',
orientation: 'LANDSCAPE'
}).then(result => {
if (result.status === 'SUCCESS') {
console.log('그림 저장 완료:', result.path);
} else {
console.error('그림 저장 실패:', result.message);
}
})
Before M.drawing.open
기존 그림 파일을 열어 편집할 수 있도록 합니다.
Parameters
options
Object
"APPINSIDE" | "APPOUTSIDE"string"PNG" | "JPG""DEFAULT" | "BUTTON""DEFAULT" | "PORTRAIT" | "PORT" | "LANDSCAPE" | "LAND" | "PORTREV" | "LANDREV" | "ALL"booleanReturn
Promise<Object>
"SUCCESS" | "FAIL"stringstringstringstringUsage
import { open } from '@morpheus/plugin-drawing'
open({
savePoint: 'APPINSIDE',
path: 'drawings/sketch1.png',
format: 'PNG',
privacy: true
}).then(result => {
if (result.status === 'SUCCESS') {
console.log('그림 열기 성공:', result.path);
} else {
console.error('그림 열기 실패:', result.message);
}
})