From 8ac5bf03224721b296a8fe78b2020aea6d3b8796 Mon Sep 17 00:00:00 2001 From: Jared Date: Sun, 17 Jan 2021 08:59:48 -0800 Subject: [PATCH] Use Image constructor instead of creating img element. --- Server/wwwroot/src/RemoteControl/DtoMessageHandler.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Server/wwwroot/src/RemoteControl/DtoMessageHandler.ts b/Server/wwwroot/src/RemoteControl/DtoMessageHandler.ts index 9d15d9076..260932d56 100644 --- a/Server/wwwroot/src/RemoteControl/DtoMessageHandler.ts +++ b/Server/wwwroot/src/RemoteControl/DtoMessageHandler.ts @@ -66,12 +66,12 @@ export class DtoMessageHandler { } if (captureFrame.EndOfFrame) { - let completedFrame = new Blob(this.ImagePartials); + let completedFrame = new Blob(this.ImagePartials, { type: "image/jpeg" }); this.ImagePartials = []; - var url = window.URL.createObjectURL(completedFrame); - var img = document.createElement("img"); + let url = window.URL.createObjectURL(completedFrame); + let img = new Image(captureFrame.Width, captureFrame.Height); img.onload = () => { UI.Screen2DContext.drawImage(img, captureFrame.Left,