Introducción al artículo de Wulin.com (www.vevb.com): para establecer el texto del lienzo HTML5 del color de trazo, podemos usar el fondo del lienzo Strokestyle y el método StroketeExt ().
Para establecer el texto del lienzo HTML5 del color de trazo, podemos usar el fondo del lienzo Strokestyle y el método StrokExtext ().
Echemos un vistazo al siguiente ejemplo:
<! Doctype html>
<html>
<Evista>
<title> html5_canvas_text_stroke </title>
<estilo>
cuerpo {margen: 0px; relleno: 0px;}
#mycanvas {borde: 1px sólido #9c9898; margen: 0 auto; margen-top: 200px; margen izquierda: 100px;}
</style>
<script>
window.onload = function () {
var lienvas = document.getElementById (mycanvas);
VAR context = Canvas.getContext (2d);
var x = 80;
var y = 110;
context.font = 60pt Calibri;
context.linewidth = 3;
context.strokestyle = azul; // color de trazo
context.StrokExtext (¡Hola mundo!, x, y);
};
</script>
</ablo>
<Body>
<Canvas id = MyCanvas Width = 578 Height = 200>
</able>
</body>
</html>