ENGO150 b895548bda
drawing test image into canvas (full)
idk if I won't remake this somehow differently
2023-05-16 15:13:10 +02:00

18 lines
463 B
JavaScript

function load_panorama()
{
console.log(window.width);
var ctx = document.getElementById('panorama').getContext('2d');
var img = new Image();
var width_buffer;
img.onload = function()
{
width_buffer = 5000;
ctx.canvas.width=width_buffer;
ctx.canvas.height=width_buffer / 2;
ctx.drawImage(img, 0, 0, img.width, img.height, 0, 0, width_buffer, width_buffer / 2);
};
img.src = './res/img/test.jpg';
}