Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Vincent Wei
web-display-server
Commits
e401e6d8
Commit
e401e6d8
authored
Nov 23, 2020
by
Vincent Wei
Browse files
fetch PNG via HTTP
parent
5b59a5f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
web/webdisplay.js
View file @
e401e6d8
...
...
@@ -30,7 +30,7 @@ WebDisplay.prototype.onmessage = function (msg) {
var
bytes
=
new
Uint8Array
(
msg
.
data
,
16
,
msg
.
data
.
byteLength
-
16
);
var
image
=
new
Image
();
image
.
src
=
'
data:image/png;base64,
'
+
btoa
(
String
.
fromCharCode
.
apply
(
null
,
bytes
)
)
;
image
.
src
=
String
.
fromCharCode
.
apply
(
null
,
bytes
);
image
.
onload
=
function
()
{
this
.
context
.
drawImage
(
image
,
dirtyRect
[
0
],
dirtyRect
[
1
],
dirtyRect
[
2
]
-
dirtyRect
[
0
],
dirtyRect
[
3
]
-
dirtyRect
[
1
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment