-2
Hello I would like to know how to correctly position the image in the center of canvass with precision?
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Index</title>
</head>
<canvas style="border:0px solid #000;width:950px; height:555px" id="canvas"></canvas>
<img src="cidade.png" id="city">
<body bgcolor="lightblue">
<script>
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
var city = document.getElementById('city');
city.onload = function(){
ctx.drawImage(city,475,277,950,555);
city.style.display = 'none';
}
var IA = Math.floor(Math.random() * 3);
</script>
</body>
</html>