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.
- Лучшие Букмекерские Конторы Онлайн Рейтинг Бк 202 - March 19, 2024
- Pin-Up Casino Türkiye En İyi Canlı Casino Oyunları ve Slot Makineler - March 19, 2024
- افضل موقع مراهنات المغرب لعام 2024: اختر افضل موقع رهان المغر - March 19, 2024
- Türkiye’nin En İyi Online Bahis Şirket - March 19, 2024
- Ставки На Регби И Коэффициенты Для Ставок На Регб - March 19, 2024
- Pin Upward Casino Resmi Web Sitesi Çevrimiçi Oyna!! - March 17, 2024
- Download Pin Up Brasil️ Online Casino App A Partir Perform Site Oficia - March 17, 2024
- Mostbet’te Bonusunuzu Nasıl Alabilirsiniz - March 17, 2024
- مراجعة 1xbet في المغرب ️ 1xbet الموقع الرسمي للمراهنة في المغرب - March 17, 2024
- شحن 1xbet مجانا معلوم - March 15, 2024