Update images.md (#26684)

pull/26695/head
S. Carstens 2022-08-10 18:41:44 +02:00 committed by GitHub
parent a2ae14b6a8
commit 74ffd55583
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 4 deletions

View File

@ -73,8 +73,11 @@ The example in this section streams image source data using [JavaScript (JS) int
const arrayBuffer = await imageStream.arrayBuffer();
const blob = new Blob([arrayBuffer]);
const url = URL.createObjectURL(blob);
document.getElementById(imageElementId).src = url;
URL.revokeObjectURL(url);
const image = document.getElementById(imageElementId);
image.onload = () => {
URL.revokeObjectURL(url);
}
image.src = url;
}
</script>
```
@ -175,8 +178,11 @@ The example in this section streams image source data using [JavaScript (JS) int
const arrayBuffer = await imageStream.arrayBuffer();
const blob = new Blob([arrayBuffer]);
const url = URL.createObjectURL(blob);
document.getElementById(imageElementId).src = url;
URL.revokeObjectURL(url);
const image = document.getElementById(imageElementId);
image.onload = () => {
URL.revokeObjectURL(url);
}
image.src = url;
}
</script>
```