Most voted "canvas" questions
Canvas is an HTML5 element intended to delimit an area for dynamic graphics rendering. All work of creation and animation is carried out through languages of dynamic programming, for example Javascript.
Learn more…209 questions
Sort by count of
-
1
votes1
answer83
viewsHow to assign an image that is on the screen as a canvas background
I have a canvas and I need to put how background an image that is already on the screen. Example: <div id="imagens"> <canvas id="canvas" width="600" height="700" style="border: 1px solid…
-
1
votes0
answers584
viewsMove an object in the direction of the "onmousemove"
I’m trying to move an object in the direction where the person presses the screen, moves and then lets go. I tried to use some loops for (was the only thing I thought of) but without success. [if…
-
1
votes1
answer48
viewsHow to determine the number of edges of radarchart?
I’m using Radarchart of Chart js.. Have that Fiddle working. Note that in this example the graph is mounted dynamically according to the entered data. Well, I would like to determine the amount of…
-
1
votes0
answers16
viewsApp using canvas does not emulate in Android Studio
I made an app in Android Studio, according to codes below, however, when emulating inside an emulator of Android Studio itself, does not run. There seems to be some problem in the Activity instance,…
android-studio android-activity canvas instantiate-object emulatorasked 3 years, 10 months ago CarlosProg 11 -
1
votes1
answer49
viewsTrying to turn canvas code into pure Javascript for React
I’m making a piano mini-game similar to Guitar Hero, where blocks fall from the sky and you have to press the note (in my case, the piano note/key) equivalent at the right time, they fall in…
-
1
votes1
answer183
viewsMultiple objects with canvas
Guys, I couldn’t find a post like this. So send me the link if you find one. With a huge problem, I am creating a game of those that the ball has to break squares on the screen and I have everything…
-
1
votes1
answer270
viewsHow to distort an image using HTML 5 Canvas
I need to apply this image: In different shapes, such as cups, bracelets, T-shirts, such as these examples I tried with component of AspJpeg, but I saw with the developers who made this component…
-
1
votes0
answers72
viewsResize image and remove borders
I’m doing an "UI" with Canvas, where only the central part is resized and then re-folded with the edges. Everything works perfectly, but as the size increases the "Smooth" of the edges too, and I…
-
1
votes1
answer1268
viewsColoring Canvas Drawing and Increasing Painting Area
I have a type of entertainment on a page where I choose a drawing that is placed inside a canvas coloring. I already have the brush and the colors. But I want something that does the function of the…
-
1
votes1
answer235
viewsPrint Content that Has Multiple Canvas
I’m making a site where you have a picture to color a drawing. After much research I managed to make a scheme to paint a certain area of the drawing of canvas. Now I want to do a function that…
-
1
votes0
answers107
viewsFlash, javascript and Html5 canvas
Hi I slider in flash player with Html5 canvas and published now I need to put it inside the div of my file but I’m not getting, the screen turns black when I replace the html file made by flash, and…
-
1
votes1
answer60
viewsmouse Hover Javascript
I managed to do it with jquery, here’s the code for whoever needs it. <script type="text/javascript" src="dist/jquery/jquery-1.12.3.min.js"></script> <canvas id="diamond" width="100"…
-
1
votes0
answers24
viewsHow do I work the exportEnable function on canvas js in internet explorer?
I have this code below that shows me a graph but in IE does not work the function exportEnable and animationEnabled in Chrome works but when I call the page in modal the screen height is short in…
-
1
votes0
answers68
viewsOne transition affects the opacity of the other by redefining 'globalAlpha' in the canvas
I’m making a game and I’m currently building a screen where there would be an opacity transition (fade in) and, upon completion, initiate another opacity transition. The problem is when the first…
-
1
votes1
answer77
viewsChartjs 2.0 Rotation
How can I rotate the text? What do I have: I’m trying to rotate but the ctx.translate doesn’t work right, see: This is my code: animation: { onComplete: function () { var chartInstance = this.chart;…
-
1
votes1
answer294
viewsManipulate an image before adding it to a canvas element
I’m adding an image dynamically into a canvas, but I’m not getting it resized properly. var img = new Image(); img.src = "http://i.stack.imgur.com/lIaBN.jpg"; function inserir() { var canvas =…
-
1
votes1
answer678
viewsChart with Canvas
I need to develop the following chart using canvas: But for now I could only draw the lines in black representing x,y. Could someone help us? Follows code made. 1-part html <!DOCTYPE html>…
-
1
votes0
answers269
viewsHow to link image on canvas with an object
I have the following class: class Sapo { private Image imgSapo; public int IdSapo { get; } public Sapo(int id) { imgSapo = new Image(); IdSapo = id; } public Image show { get { imgSapo.Source = new…
-
1
votes1
answer206
viewsHow to use "time" transitions in a Canvas animation
Giving sequence to the post "How to generate a Sine curve", where I made some adjustments: I am still working on this ECG simulator (electrocardiogram), and now I need to "manipulate" the times…
-
1
votes0
answers268
viewsResponsive canvas effect
I have a responsive web page where I have a light effect using the canvas. It turns out that the effect should remain only on the banner area, I did here a method using the negative margin-top, but…
-
1
votes0
answers140
viewsGenerate a PDF of a Morris Graph
I’m developing an application that generates a report using Morris charts (https://startbootstrap.com/template-overviews/sb-admin-2/) The graphics are working properly, now I need to generate a PDF…
-
1
votes1
answer40
viewsAngular Bind with Canvas
Good morning I would like to know if it is possible to bind and/or force angular bind with canvas. My problem is this: I am using canvas to give a graphical representation to my client and for UI I…
-
1
votes0
answers35
viewsSearch Array with certain features
Hello, I am developing a very basic game with Javascript, but I came across a little thing that I could not solve so far, the question would be, I have an Array, in which I include randomly 28…
-
1
votes1
answer863
viewsButton to enable drawing and clear canvas
// forked from makc's "Simplify this three.js drawing exmple" http://jsdo.it/makc/zXNX var mouse = { x: 0, y: 0, down: false }; var scene, camera, renderer, raycaster = new THREE.Raycaster (), mesh;…
-
1
votes1
answer119
viewsProblem with events in Vuejs 2
I found a code a while back and modified it in pure javascript. It worked fine. But now I have to do something similar to what he does in Vue. The problem is that I’m kind of new in Vue and I have…
-
1
votes0
answers26
viewsns_error_not_available when placed on the web server
I made a mini game on the localhost and everything was working perfectly.. Then I uploaded it to the web server and the game started crashing with the error "NS_ERROR_NOT_AVAILABLE:". ... var…
-
1
votes1
answer445
viewsHow does "Restore" and "save" work?
I was trying to understand the workings of the methods save and restore of canvas and I looked on the page of MDN. I still don’t understand what the difference is between using them or not.…
canvasasked 6 years, 10 months ago Wallace Maxters 102,340 -
1
votes1
answer29
viewsMount a Strobe Light inside the JS canvas
I have a task to develop for college but I’m having some problems. First let me try to explain what to do: I need to simulate a strobe light based on a few colors in an HTML selector. The user…
-
1
votes1
answer1686
viewsGet external website image as data:image/jpeg;Base64
Is it possible to save an image as an external website date using javascript or php? because this was the only way I could get q the image to appear in the browser, when inspecting this is the way:…
-
1
votes1
answer61
viewsJavascript - drawRect is interfering with the background color
When I put one squared in canvas the bottom turns white. (function(){ var c = document.createElement("canvas"); var ctx = c.getContext('2d'); var fps = 30; var height = 300; var width = 300; var…
-
1
votes1
answer23
viewsCode error in <canvas>
I’m using a jsfiddle code (http://jsfiddle.net/z52eh9vd/) to create lines, through the canvas (over a map, to make a route) - I am very much started in the same programming! the canva is there, the…
-
1
votes0
answers71
viewsDrawing in the middle of the screen with the android canvas
How to draw in the middle of the screen, in all the attempts I made I could just stretch the drawing and not move it to the center of the screen. public class Carta { private static int…
-
1
votes1
answer77
viewsRotate points belonging to a Bezier curve in canvas js
all right? I’d like help with a problem I recently got while working with JS. I need to make a function in JS that can rotate a set of points present in a Bezier curve. I previously researched a way…
-
1
votes1
answer896
viewsPrint two or more pages using jsPDF
I’m generating my own html in PDF with JsPDF. My html is larger than an A4 sheet. To solve the problem I need to create paging in Jspdf. Code I have that only generates pdf with a page:…
-
1
votes1
answer526
viewsMake image appear stay a while and then disappear - JS
I’m playing a game of snake (Snake) and I need to make an image appear on the canvas every 3 seconds, but it needs to last 4 seconds before it disappears. I’m trying to use the setInterval() but the…
-
1
votes1
answer71
viewsCopy CANVAS with background image to an image
I have a CANVAS in which I put a background image and on top of that image I do some drawings. Then I need to transform this CANVAS into an image, I used the commands below to make the copy but the…
-
1
votes0
answers17
viewsCanvas Constellation Interactive Mobile
Good afternoon, I have a code from a canvas Constellation that interacts with the mouseover pulling the links from the stars to next to the mouse, and would like to do in mobile the same thing, for…
-
1
votes1
answer47
viewsHow to capture the onRendered event from a canvas?
How to know if the canvas is ready? I’m using the library fabricjs, that creates a complex element structure within a canvas, but I’d like to call a callback function after the canvas had all the…
-
1
votes0
answers45
viewsHow to go down with an object on the canvas
I’m creating a 1970 game design similar to this: When I ask the canvas to draw the ball down, instead it continues a line like this: Follows the code: ball = { xStart: 190, xEnd: 15, yStart: 200,…
-
1
votes1
answer55
viewsHow to add a header to a captured image with html2canvas?
I am trying to issue a subscription voucher on a page, and in it you have the option to save the voucher as image, on the voucher page DO NOT have the header with the company logo and the name of…
-
1
votes1
answer63
viewsProblem when trying to rotate a triangle using the javascript canvas
Guys, below, I have the following codes in a basic structure using html, css and javascript. I tried anyway, but I couldn’t rotate the triangle in the middle when the user slides the input range.…
-
0
votes1
answer218
viewsMost suitable API - Opengl ES 2.0 x Canvas x Drawable
Good morning, I would like to make an application for Android to do the following: display the plan of a home on mobile, and the user touch a room on the screen, the color of the room change. I’m…
-
0
votes1
answer2244
viewsHow to handle addeventlistener event click in javascript
I need to develop a game using HTML 5 and Javascript with the game inside a canvas. I created a game opening screen and after that click on play it directs to another screen. I called this way the…
-
0
votes1
answer766
viewsCanvas is not showing the image with drawImage()
I have an index.html with the following code: <!DOCTYPE html> <html> <head> <title> HTML 5 - Airplane Game</title> <link rel="stylesheet" href="gamestyle.css"/>…
-
0
votes0
answers214
viewsHow to create the Hover effect with two canvas superimposed with opposite effects?
Previous Code. *Below is the example of the code: Jsfiddle Antigo New code for anyone! Jsfiddle Novo…
-
0
votes1
answer60
viewsHow do canvas toDataURL work on images on another server?
I have a Facebook app where I get a picture of the user’s profile. How to paste this image over another one by making a montage to be then shared on fb itself. The canvas toDataURL method does not…
-
0
votes2
answers864
viewsHow to upload image canvas
I get the result of an image through this function this.canvas.toDataURL('png'), this function generates the image normally, the dots are: How to upload this to the PHP server using jQuery? Is it…
-
0
votes2
answers816
viewsRotate Canvas in Delphi
I need to rotate an object inside a canvas at Delphi. Example rotate by 90 degrees. Text I get is easy, but I have to be able to do for any type drawn object. As for an image drawn on canvas or a…
-
0
votes1
answer135
viewsHow to get toDataURL to save in a sessionStorage?
I’m using a library I picked up here at this link: https://github.com/fengyuanchen/cropper Only I already spent 2 days testing and looking for how to get the image cut with toDataURL to catch the…
-
0
votes1
answer150
viewsCanvas - getWidth(), getHeight() and Onclicklistener()
I’m making an app for Android using the Canvas class, but I’m having some problems. 1º. When executing the methods below, canvas.drawText("Width: " + fotoOriginal.getWidth(), 0, 10, paint);…