SVG Notepad with preview - Forum

Forum Navigation
You need to log in to create posts and topics.

SVG Notepad with preview

Hello to the community,

I try to make a text editor for svg that you can test with preview. I try my best but I can't find a solution. The code is really simple.

Is someone can help me?

I have a test code please copy and paste it:

<svg width="200px" height="200px" viewBox="0 0 200 200">
  <!-- parallelogram -->
  <polygon points="15,10  55, 10  45, 20  5, 20"
    style="fill: red; stroke: black;"/>

  <!-- star -->
  <polygon
    points="35,37.5  37.9,46.1 46.9,46.1  39.7,51.5
      42.3,60.1  35,55  27.7,60.1  30.3,51.5
      23.1,46.1  32.1,46.1"
      style="fill: #ccffcc; stroke: green;"/>

  <!-- weird shape -->
  <polygon
    points="60 60,  65 72,  80 60,  90 90, 72 80, 72 85, 50 95"
    style="fill: yellow; fill-opacity: 0.5; stroke: black;
      stroke-width: 2;"/>
</svg>

and the app is a small one. Please download it.

 

Uploaded files:
  • You need to login to have access to uploads.

@sakismor , you need Set HTML content

in your preview button:

.SetVar [SVGcode] [SVGPreview]
SetObjectHTML "Container1" "[SVGPreview]"

 

luishp has reacted to this post.
luishp

I am really thank you. It was so simple.

I have one more question. Is it possible to write visualneo web code is TextArea and run it?

I like to change my code and then test it.

I have one more question. Is it possible to write visualneo web code is TextArea and run it?

@sakismor that's not possible. That would be a big security issue.

Please take a look here for more information:
https://www.w3schools.com/jsref/jsref_eval.asp
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval

Regards.

OK I understand it that.

What about the VisualNeo win is that possible?

To make a TextEntry to write VisualNeo win code and to have a button to run it.

Is that possible?

To make a TextEntry to write VisualNeo win code and to have a button to run it.

@sakismor Yes it is possible using the PlayAction command.

Regards.