30 const char* data = buffer.data();
31 size_t length = buffer.size();
37 let path = UTF8ToString($0);
38 let section = HEAPU8.subarray($1, $1 + $2);
39 let array =
new Uint8Array(section);
40 let blob =
new Blob([array], {
"type":
"image/png"});
41 globalThis.snapshotURL = URL.createObjectURL(blob);
43 let link = document.querySelector(
"#snapshot-download");
44 link.href = snapshotURL;
47 document.querySelector(
"#snapshot-image").src = snapshotURL;
48 document.querySelector(
"#snapshot-overlay").classList.add(
"visible");
49 }, filename.c_str(), data, length);
SLIOStream implementation for reading to memory.
std::vector< char > & get(std::string path)
void clear(std::string path)
string getFileName(const string &pathFilename)
Returns the filename of path-filename string.
bool endsWithString(const string &container, const string &endStr)
Return true if the container string ends with the endStr.