Es posible dibujar curvas Bezier directamente en la página web con instrucciones utilizando el canvas de HTML5 y el método beziercurveTo.
¿para que sirven las curvas de bezier?
Las curvas de bezier sirven para hacer curvas bonitas, de hecho son un método matemático para describir curvas y que ha sido implementado en los sistemas CAD, Photoshop y quien sabe cuanta herramientas más, y,, como pronto se viene el evento de RailsGirls 2.0 hice este post Temático.
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript">
function drawShape(){
// get the canvas element using the DOM
var canvas = document.getElementById('mycanvas');
// Make sure we don't execute when canvas isn't supported
if (canvas.getContext){
// use getContext to use the canvas for drawing
var ctx = canvas.getContext('2d');
ctx.beginPath();
ctx.fillStyle = "rgba(200,0,0,0.5)";
ctx.moveTo(75,40);
ctx.bezierCurveTo(75,37,70,25,50,25);
ctx.bezierCurveTo(20,25,20,62.5,20,62.5);
ctx.bezierCurveTo(20,80,40,102,75,120);
ctx.bezierCurveTo(110,102,130,80,130,62.5);
ctx.bezierCurveTo(130,62.5,130,25,100,25);
ctx.bezierCurveTo(85,25,75,37,75,40);
ctx.fill();
ctx.font = "bold 16px Arial";
ctx.fillText("Rails Girls 2.0", 100, 100);
} else {
alert('Necesitas un navegador moderno para poder ocupar el canvas de Html5 .');
}
}
</script>
</head>
<body onload="drawShape();">
<canvas id="mycanvas"></canvas>
</body>
</html>
¿y no sería lo mismo ocupar una imagen hecha en photoshop?
Claro, de hecho sería mucho más fácil, pero aquí viene el siguiente desafío, ya que el canvas de html5 se puede limpiar cada cierto tiempo como en este experimento, podrías ocupar las curvas de bezier para hacer una animación interesante.
- Pin Up Casino Oyna Türkiye, Pinup’un Resmi Web Sites - April 3, 2024
- All The Classic Pinup Positions For Vintage Elegance Photoshoot - April 3, 2024
- وان إكس بت ويكيبيدي - April 3, 2024
- ️ أفضل مواقع المراهنات الرياضية احصل على أفضل مكافآت الترحي - April 3, 2024
- ️ أفضل مواقع المراهنات الرياضية احصل على أفضل مكافآت الترحي - April 3, 2024
- 1win Bahis Şirketinin Resmi Web Sitesi 1win 2023 Online Spor Bahisleri, 1win Bahis Şirketine Giriş Yapın - April 3, 2024
- “المراهنات الرياضية أونلاين 1xbet ᐉ شركة المراهنات 1xbet تسجيل الدخول ᐉ 1xbet Co - April 2, 2024
- Pin Upward Casino Giriş, Üyelik, İndirme, Promosyonla - March 31, 2024
- Pin Up On Line Casino Türkiye Giriş Yapın Ve 0 Bonus Kazanı - March 31, 2024
- تنزيل 1xbet => جميع إصدارات 1xbet Sixth Is V 1116560 تطبيقات المراهنات + مكافأة مجاني - March 31, 2024