There is no blur when I run the code in the compilers on the internet, but it seems quite blurry when I run it on my project. What could be the reason for this? Photos and codes are below.
.ts code
public DrawTheTree() {
var canvas: HTMLCanvasElement = document.getElementById("tree_canvas") as HTMLCanvasElement;
var context: CanvasRenderingContext2D = canvas.getContext("2d") as CanvasRenderingContext2D;
context.beginPath();
context.font = "16px Comic Sans MS";
context.fillStyle = "white";
context.textAlign = "center";
context.fillText("Animals", 150, 15);
context.closePath();
}
.html code
<canvas id="tree_canvas" class="tree_canvas_class"></canvas>
.css code
.tree_canvas_class {
background-color: darkblue;
width: 936px;
height: 435px;
}
BlurryPhoto:https://www.dropbox.com/s/mle8vepnyesapip/Capture.JPG?dl=0 DesiredPhoto: https://www.dropbox.com/s/g0fwn46ibrgascy/ss.JPG?dl=0