Lamentablemente, su navegador no soporta el elemento canvas.
Primero creamos una variable para hacer referencia al nuevo elemento canvas fuera de la pantalla que se creará.
We first create a variable to reference the new off-screen canvas element to be created.
Las imágenes de trama por lo general provienen de cámaras o escáneres, o pueden crearse en el navegador con el elemento canvas.
Raster images typically come from a camera or scanner, or can be created in the browser with the canvas element.
Editando el estilo del elemento canvas cambiara su tamaño mostrado pero no cambiara la resolución de renderizado.
Editing the style of a canvas element will change its displayed size but will not change its rendering resolution.
Uno de los usos más prácticos de esto sería utilizar un segundo elemento canvas como una vista en miniatura del otro lienzo más grande.
One of the more practical uses of this would be to use a second canvas element as a thumbnail view of the other larger canvas.
Editando los atributos de anchura y altura de un elemento canvas después de crear el contexto tampoco cambiara el numero de pixeles a ser renderizados.
Editing the width and height attributes of a canvas element after the context has been created will also not change the number of pixels to be drawn.
Cuando se carga la página, para cada imagen de la página se inserta un elemento canvas y se dibuja un marco alrededor.
When the page is loaded, for each image in the page a canvas element is inserted and a frame is drawn around it.
Una vez que hemos establecido la mayor parte de la lógica, vamos a ver cómo se representa el papel que se dobla en el elemento canvas.
Now that most of our logic is in place we'll go through how to render the folding paper onto the canvas element.
El primer parámetro image, al igual que las otras variantes, es o bien una referencia a un objeto de imagen o una referencia a un elemento canvas diferente.
The first parameter obrazek, just as with the other variants, is either a reference to an image object or a reference to a different canvas element.
Las otras dos lineas de código en la función preload() son responsables de alinear el elemento canvas horizontal y verticalmente, por lo que siempre se centra en la pantalla independientemente del tamaño.
The other two lines of code in the preload() function are responsible for aligning the canvas element horizontally and vertically, so it is always centered on screen regardless of size.
Sin el framework para añadir el elemento canvas hubieses tenido que escribir algo como esto dentro de la etiqueta<body
Without the framework, to add the Canvas element to the page, you would have to write something like this inside the<body>tag
Por esta razón, el contenido con el que trabajaremos se incluye las diferentes páginas del libro y el elemento canvas sobre el que dibujaremos las páginas que pasaremos.
We have one main container element for the book, which in turn contains the different pages of our book and the canvas element that we will be drawing the flipping pages on.
Agrega el siguiente código en el archivo Esto obtiene una referencia al elemento canvas y después establece el ancho y alto a 300px.
This gets a reference to the canvas element and then sets the width and height to 300px.