get outlook data

This commit is contained in:
Matt Walsh
2020-09-23 14:43:49 -05:00
parent 37eb88a90d
commit 24855fd959
4 changed files with 175 additions and 4 deletions

View File

@@ -58,6 +58,22 @@ const utils = (() => {
return true;
};
// draw an image on a local canvas and return the context
const drawLocalCanvas = (img) => {
// create a canvas
const canvas = document.createElement('canvas');
canvas.width = img.width;
canvas.height = img.height;
// get the context
const context = canvas.getContext('2d');
context.imageSmoothingEnabled = false;
// draw the image
context.drawImage(img, 0,0);
return context;
};
// *********************************** unit conversions ***********************
Math.round2 = (value, decimals) => Number(Math.round(value + 'e' + decimals) + 'e-' + decimals);
@@ -374,6 +390,7 @@ const utils = (() => {
load: loadImg,
superGifAsync,
preload,
drawLocalCanvas,
},
weather: {
getPoint,