How can I insert "img" to json format

Hi,

I have problem when I want to insert “img” tag into “Diagram Model saved in JSON format”.
Use Page Flow for example:
The original example look like this:

and I want to add “img” on the node, so the code like this:

but the “save” button can’t show out the “img” resource document.getElementById("mySavedModel").value = myDiagram.model.toJson();
the result I want is something look like this:

Best regards,
Danny

Unless some code sets the Picture.source property to a new value, the TwoWay Binding will not update the data.img model data property.

Why is this important to you? Loading a model with no data.img property will correctly cause the Picture to show the “temp1.jpg” image. For exactly the same reason, if there is no data.text property value, the TextBlock will show the string “Source0”.

Hello Can you show an example please, I have a same case to bind the image in the json?

   $(go.Picture,
     { width: 64, height: 64 },
     { sourceCrossOrigin: function(pict) { return "use-credentials"; } },
     new go.Binding("source", "path"))

I have used the same pattern to bind the source to the model, but I cannot see the source url in model Json

It’s not clear what you’re asking. If you just want to bind the Picture.source, you can include that path property in your JSON.