From 6ab0d02a61dda8bb22062383c97e7be9971ddfbc Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 23 Jul 2017 14:26:18 +0300 Subject: [PATCH] #179. Add canvas save script gen. --- .../scriptgen/SaveImageToFileCanvasScriptGen.xml | 16 ++++++++++++++++ .../formats/form/elements/CanvasFormElement.php | 1 + 2 files changed, 17 insertions(+) create mode 100644 develnext/src/.dn/bundle/uiDesktop/scriptgen/SaveImageToFileCanvasScriptGen.xml diff --git a/develnext/src/.dn/bundle/uiDesktop/scriptgen/SaveImageToFileCanvasScriptGen.xml b/develnext/src/.dn/bundle/uiDesktop/scriptgen/SaveImageToFileCanvasScriptGen.xml new file mode 100644 index 00000000..d62f6bc1 --- /dev/null +++ b/develnext/src/.dn/bundle/uiDesktop/scriptgen/SaveImageToFileCanvasScriptGen.xml @@ -0,0 +1,16 @@ + + Сохранить рисунок + Сохранить нарисованное изображение canvas в файл + FormEditor.objectItem + + #object.id#->save($filename, fs::ext($filename)); + ]]> + \ No newline at end of file diff --git a/develnext/src/ide/formats/form/elements/CanvasFormElement.php b/develnext/src/ide/formats/form/elements/CanvasFormElement.php index e4b186cf..86846249 100644 --- a/develnext/src/ide/formats/form/elements/CanvasFormElement.php +++ b/develnext/src/ide/formats/form/elements/CanvasFormElement.php @@ -90,6 +90,7 @@ public function getScriptGenerators() return [ new IdeLibraryScriptGeneratorResource('res://.dn/bundle/uiDesktop/scriptgen/DrawLineCanvasScriptGen'), new IdeLibraryScriptGeneratorResource('res://.dn/bundle/uiDesktop/scriptgen/DrawSVGCanvasScriptGen'), + new IdeLibraryScriptGeneratorResource('res://.dn/bundle/uiDesktop/scriptgen/SaveImageToFileCanvasScriptGen'), ]; } }