archive svgMethodDraw svg-edit v18R2 Popular

By 225 downloads

Download (zip, 17.76 MB)


2020-0704 v1.2 svgMethodDraw

Add svg_COMBINE_PICTURES to combine svg picture. Demo: __start2


2020-0703 V1.1 - added a form to edit with a method call, colors modifiers

$isOk:=svgEdit_edit_form ($ptr_picture;{$form_type:palette};{$is_editable:true})

svgEdit_domPicture_colors ($svg_dom;$color_stroke_txt;$color_fill_txt)  // Changes stroke and fill attributes

  // Change only not "none" values in destination,

  // and only for not "none" values for $color_stroke_txt & $color_fill_txt


2020-0702 V1.0 - initial version

This component allows you to edit any svg picture with this amazing svg editor: https://editor.method.ac/

The web module is offline, inside the component itself.

See inside for how to use it with __start.



  // Basics


$version:=svgEdit_getVersion ({$formName})  // Get version


svgEdit_setEditor ({$editor_type};{$formName})  // Editor version ; use 0 or none


svgEdit_new ({$formName})  // Clear editor


$isModified:=svgEdit_isModified ({$formName})


svgEdit_setEnabled ($is_enabled;{$formName})  // editor enabled or not


svgEdit_resize ($border;{$formName})  // set border and recalculate the widget content based on size

// $border = -1 => no border change



// SVG getter and setter


$svg_txt:=svgEdit_getSvgString ({$formName})  // get svg from editor


$isOk:=svgEdit_setSvgString ($svg_txt;{$formName})  // set svg to editor



  // Picture manipulation

$svg_txt:=svgEdit_pictureToSvg ($picture)  // picture to svg text

// If no svg dom found, will create an svg dom based on the bitmap


$picture:=svgEdit_svgToPicture ($svg_txt)  // svg text to a picture

// The svg is cleaned with svgEdit_domPicture_clean too


// Utilitary


svgEdit_domPicture_clean ($svg_dom)  // Clean up the svg given by the editor

// remove all attributes "Null" and "undiefined" -> make errors with 4D's svg parser