• 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.
  • Hizli Para Yatirma Yontemleri Most bet Kullanicilari Icin - July 11, 2025
  • Aprovecha los bonos de bienvenida en Mostbet - July 11, 2025
  • Complete Guide to Non GamStop Online Casinos for Players Seeking Alternatives - July 11, 2025
  • Mainkan Pertandingan Daring Mahjong Untuk Mendapatkan Uang - June 7, 2025
  • No Deposit Bonuses Available for Gamstop Players Revealed and Analyzed - May 30, 2025
  • Kazanma Sansinizi Artirmak Icin MostBet ile Bahis Yapma Yontemleri - April 9, 2025
  • Mostbet ile guvenli ve adil oyun - April 8, 2025
  • Updated login for Mostbet casino - April 6, 2025
  • Mostbet AZ giris ve qeydiyyat online casino - April 5, 2025
  • Mostbet Site Oficial: Join Today, Begin Adventure - April 4, 2025
10 years ago 1 Comment Diseño, Html5html5, RailsGirls3,136
Twitter Search API + Ruby on Rails (II parte)El juego de Bezier
You Might Also Like
 
audio una etiqueta para experimentar en HTML5
 
RailsGirls Santiago 2014 (2º edition)
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 casinohtml5gratogana entrargratogana juegos en vivo20bet logowanieWordpressrubyLanding PageBases de datosplaycroco casinoplay crocogratogana onlineparty poker casino
  • 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