Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

Downloading an image of the diagram

$
0
0

@Doogal wrote:

I'm trying to use makeImageData to generate an image that the user can download. It's working fine in Chrome and FireFox but nothing is happening with IE. I don't think it's a problem with makeImageData, the function returns something that looks kind of sensible, but I'm just wondering the recommended approach for doing this, as I assume it's what makeImageData is primarily for? I'm just assigning the return value to an anchor's href after the user has clicked on it. HTML snippet is

            <li id="model-image">
              <a href="#" download="diagram.png">
                <img src="Content/Images/image.png" /><br />
                Image
              </a>
            </li>

TypeScript snippet

    $("#model-image a").on("click", (e) => {
      var imageData = this.diagram.makeImageData();
      $("#model-image a").attr("href", imageData);
    });

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles