• Inspiración
  • Tutoriales
  • Bootcamp

En1Mes

  • Inspiración
  • Tutoriales
  • Bootcamp

Dibujando con curvas bezier en HTML5

Dibujando con html5 y curvas bezier

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.

Sep 25, 2014Gonzalo Sánchez
Share Button
  • El Autor
  • Últimos Posts

About Gonzalo Sánchez

Emprendedor lean, Ingeniero civil informático dedicado al desarrollo de una mejor web con ruby on rails. Fanático de los números y las métricas y por sobre todo fundador de en1mes.
  • Yükleme rehberi – Kraken Casino konusunda sık sorulanlar 🛡️ - July 16, 2025
  • MostBet Secimleri ile Ugurlu Bahis Stratejileri - July 16, 2025
  • Alev Casino ile kazancına ⭐ kazanç kat - July 16, 2025
  • Betting Platform by Most Bet: Your Guide to Winning Big - July 16, 2025
  • Live tikishlar orqali ko’proq yutuqlar: Mostbet sizga yordam beradi - July 16, 2025
  • Alev Turkiye – Canlı Bahis ve Slot Oyunlarında Yuksek Kazanc - July 15, 2025
  • Lüks Casino canlı casino keyfini cebine getiriyor 💥 - July 15, 2025
  • Harness the Potential of Online Betting with Our Step-by-Step Guide to Mostbet - July 15, 2025
  • Mostbet Sitio Oficial: Donde Comienza la Diversion - July 15, 2025
  • Discover Top Betting Opportunities with MostBet - July 15, 2025
10 years ago 1 Comment Diseño, Html5html5, RailsGirls3,140
Twitter Search API + Ruby on Rails (II parte)El juego de Bezier
You Might Also Like
 
Imágenes de fondo con Background-cover de CSS3
 
audio una etiqueta para experimentar en HTML5
Comments: 0
Pingbacks: 1
  1. The Beziér Game | En1mes
    10 years ago

Leave a Reply Cancel reply

Tags
mostbetslotticamostbet UZslottica PLkudos casino no deposit bonuskudos casino bonus codeskudos casino free chipkudos casino loginRuby on Railskudos casino sister siteskudos casino free spinskudos casino no deposit bonus codesaviatoraviator KZozwincasinoozwincasino AUemprendimientos digitalesfortunetigerfortunetiger BRTutorialesDiseño20bet plbet20 casinokudos casinoLondonLondon UZ20 betbj88slottica BR20bet casino logowanie20bet kasynoHerramientas20 bet casinohtml5หวยออนไลน์gratogana entrargratogana juegos en vivo20bet logowanieWordpressrubyLanding PageBases de datosplaycroco casinoplay crocogratogana online
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • PADANGTOTO
  • Interesado en otros tipos de emprendimiento?

    Quieres aprender a importar y exportar productos a todo el mundo? entra aquí

  • LOMBOKTOTO
  • LOMBOKTOTO
  • LOMBOKTOTO
  • LOMBOKTOTO
  • LOMBOKTOTO
  • LOMBOKTOTO
  • LOMBOKTOTO
  • LOMBOKTOTO
  • LOMBOKTOTO
  • LOMBOKTOTO
  • LOMBOKTOTO
  • LOMBOKTOTO
  • LOMBOKTOTO
  • LOMBOKTOTO
  • No te pierdas ningún artículo.

  • RAMALANTOTO
  • RAMALANTOTO
  • RAMALANTOTO
  • RAMALANTOTO
  • RAMALANTOTO
  • RAMALANTOTO
  • RAMALANTOTO
  • RAMALANTOTO
  • RAMALANTOTO
  • RAMALANTOTO
  • RAMALANTOTO
  • RAMALANTOTO
  • RAMALANTOTO
  • RAMALANTOTO
  • 2016 © En 1 Mes