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
-
0
votes1
answer110
viewsButton on top of a View with Canvas
I’ve been trying for some time to put a Button on top of a View I’m using with Canvas. I looked in several places (this seems to be a common problem) but found no answer. When I try to run the…
-
0
votes1
answer197
viewsJava - Canvas flashes when redesigning the screen
I’m making a graphical application with the class Component, but every time I delete the canvas to draw a new frame, Canvas flashes! The clearBackground function: public void clearBackground() {…
-
0
votes1
answer102
viewsChartjs rotate text
I would like to know, I have a text created with canvas in chartJS]. How to rotate the text, the same being vertical in the center of the line. I tried with Rotate, but the text disappeared from the…
-
0
votes0
answers341
viewsChange the position of an object on a map
Guys, I need a logic that, by detecting whether the value of x, y changed, change the position of an object on the map. I have a map that contains 50x50 tiles, and in these Tiles there are objects…
-
0
votes1
answer187
viewsHow to draw 2 images on canvas with different fps
Let’s imagine 2 images imagem A and imagem B, I want to draw the imagem A at 60 fps, and imagem B at 30 fps. I wanted to know (using requestAnimationFrame) what is the best way to do this, should…
-
0
votes1
answer33
viewsHow to add Id to canvas on Android?
I need to add a circle across the canvas every time I click a button (identical behavior to Paint from Windows). But to move the circle clicked on the screen I need an Id. Does anyone have any idea…
-
0
votes2
answers344
viewsWave-shaped chart Canvas JS
How can I make a wave-shaped chart using Canvas and JS. The example can help a little more:…
-
0
votes2
answers951
viewsDraw a circle on an image with Javascript
I have an image and when I click on this image, I want to mark with a circle the place where I clicked. I also need to take the position to record later in the bank, because when I open the image…
-
0
votes1
answer223
viewsFigure drawn in canvas is not appearing
I made the code below to create a canvas that draws in its space a red rectangle. However, nothing appears. I can’t find any syntax error. I’m using Google Chrome: <!DOCTYPE html> <html>…
-
0
votes0
answers145
viewsSave canvas image with filters
I add image filters to the canvas, but have to save the image in the database and when I do the image saved without the filters, save the original. My database is connecting through Ajax and I do…
-
0
votes2
answers60
viewsCanvas draw grid as backgound
I did some research but I didn’t find much information. What I intend to do is draw a grid as a background in the canvas. I saw some examples with svg and others directly on the canvas. Assuming…
-
0
votes1
answer76
viewsdo not delete the image on canvas
hello, good morning. I have a fixed image on the canvas and some buttons to draw or delete what was drawn, but I have a problem: when I use the erase button it erases everything (including the…
-
0
votes1
answer37
viewsHow to make a funnel responsive table?
I’m trying to do similar to this image: Here’s a Fiddle as far as I can go The data will be dynamic, and I need the corners to be rounded. I accept other alternatives or suggestions for mounting…
-
0
votes0
answers178
viewsUpload images increasing the file size by almost 10x
Good afternoon dear programmers benefactors. I have a problem, as I described in the title, that is affecting my image uploads. The image increases up to 10 times the size. And I’m not talking about…
-
0
votes0
answers461
viewsCanvas Draw Tbitmap Multiple Images
Would you like to capture several images and "join" them all in one without having to save them first, I capture 6 images put one over the other according to the position on the screen and saved in…
-
0
votes1
answer1066
viewsDiv for canvas
Hello, I’m having a problem turning a div into canvas, because inside this div has an img, and src contains the FULL image url, with http, when it is a normal image that is already on the server I…
-
0
votes1
answer40
viewsWhere to place canvas Rotate in this code
I searched a lot, but unfortunately I did not find where the canvas Rotate function I could add in this code. In html I have an input type ranger that I use to rotate the image.. The input type…
-
0
votes2
answers284
viewsDar Foreach label on Chartjs / Canvas - Codeigniter
I have a problem here, which may be simple, I don’t know I’m using a frame for the chart, where I can put the boxes I want so that it will be displayed at each bar. Getting like this: Each item…
-
0
votes0
answers66
viewsRemove spaces from the image div using Canvas
I have a div, where I’m saving the content using canvas <div class="container-capa"> <img src=~/Content/imagemcartaovisita/@Session["NomeCapaCartao"] class="img-responsive" id="capa" alt=""…
-
0
votes0
answers372
viewsHow to bring a page with graph inside a div in another page using ajax?
I have a problem, I have a simple function in Ajax that brings a page within a div, made the test work, but when I do to bring a page that has graphic does not bring anything, Does anyone know if…
-
0
votes1
answer117
viewsResponsive mouse events with canvas?
I have the following code: var block = false; var context; var drawing; var rect; $(function() { context = $('#canvas')[0].getContext('2d'); drawing = false; rect =…
-
0
votes1
answer59
viewsRemove input box from canvas
I am trying to make a text tool of a drawing application with an input box, using the library Canvasinput. I can apply the text I write to the canvas by clicking on enter, but I am unable to remove…
-
0
votes1
answer209
viewsSave Canvas as Image - UWP
In applying UWP, I have the following canvas <Canvas Name="Banner" Width="500" Background="Black" Height="200" Margin="334,53,-711,-156"> <Image x:Name="img_Fita" HorizontalAlignment="Left"…
-
0
votes1
answer335
viewsCanvas painting
I have this code below in HTML, CSS and Javascript, and I’m using a Javascript library called Three.js. I am having a problem to perform an insertion in the code. This code makes paintings on Planes…
-
0
votes1
answer601
viewsHow to map an image using Google Areas and Coordinates.Cloud.Vision.Api
Hello, friends! I’m trying to map an image, using the Html5 "Area" tag that works with polygons, I want to map a rectangle or several rectangles on top of an image "img". My doubt is, I have a map…
-
0
votes0
answers74
views<img> inside div does not appear when used canvas2image
I’m using a script to save a div in png. Inside this div has one , but this image does not appear in the final result, after saving. The code I’m using is this $(function() {…
-
0
votes0
answers54
viewsHow to draw an OBB in Javascript?
I’m having serious difficulty designing an OBB. Follows the code: window.onload = function() { var canvas = document.getElementById("canvas"), context = canvas.getContext("2d"), width = canvas.width…
-
0
votes0
answers50
viewsinteract with TD with canvas line on the TABLE
I have a common table informed given radius of geometric coordinates, as in the image below: There is a javascript function that calculates the distance from the char point (0,0)' to any marked…
-
0
votes0
answers39
viewsJquery loop to read 3 objects and create 3 dataPoints for Charts canvas
I’m trying to accomplish the loop on the return of this request AJAX. In the first event success, I make a second call AJAX which will return - in this case - 3 objects JSON. My doubt is how to…
-
0
votes0
answers304
viewsHow to rotate and move the canvas with the keydown?
Talk guys! I’m a beginner in JS and HTML. There’s a lot I understand the reasoning but I get in the way of coding. I’ll try to explain what I’m trying to do. I am drawing a triangle (called Jack),…
-
0
votes1
answer45
viewsHow to duplicate a triangle randomly within the canvas?
I’m trying to duplicate a triangle randomly within the canvas when you press some key, like space bar or other. But I don’t know how to duplicate if I have to use some kind of constructor/array.…
-
0
votes0
answers200
viewsHow I can create a rectangle with Java Script
I am trying to create a rectangle using Javascript, avoiding using the functions of the canvas as moveto and drawto. However my rectangle does not look good. Follows the code: function retangulo(x1,…
-
0
votes0
answers28
viewsHow to implement a Gameview code within a class?(in java code for android)
I am new in java and I am developing a project, I have the following code below: Paint.setColor(Color.rgb(250, 0, 255)); canvas.drawCircle(Xa, ya, 10, Paint); Which I use in the Gameview draw method…
-
0
votes0
answers245
viewsHow to detect collision in simple html, javascript?
<!DOCTYPE html> <html> <head> <meta charset="utf-8"/> <title>Jogo</title> </head> <body> <canvas id="jogo"…
-
0
votes1
answer51
viewsAdd "loading" animation to the canvas element while generating the image
How can I add a simple (any) "loading" animation to the center of the canvas tag that is created while generating the image? (Obs: canvas size may change) ; Below in the script it is generating…
-
0
votes1
answer497
viewsJspdf and responsive canvas
I’m generating PDF with jspdf and do the screenshot with the canvas. The form which generates the PDF is very large and generates more than one page. Code: window.html2canvas = html2canvas; function…
-
0
votes1
answer62
viewsHow do I only style a fillText on Canvas?
I’m implementing a system that manages a file. gif with the client’s email signature, with the properties: name, sector, phone, extension and email. The only problem so far is styling each property…
-
0
votes0
answers224
viewsError Saving Image in Directory - PHP/JAVASCRIPT
Hello, I’m trying to finish a part of a system, where the user draws his signature and after the action, the Canvas Image is sent to the directory, but when I open the Saved image appears the…
-
0
votes1
answer76
viewsIs it possible to add img to CANVAS after window.load?
Good afternoon Devs o/ I have a question, I need to insert an image to <canvas>. But that’s not all, I’m putting together a blog creation system for Instagram, so I have several templates in…
-
0
votes0
answers23
viewshow to make the hedge move towards the cursor arrow
Next I wanted to do something like this hedge animation, however I do not know how to make the cover follow the mouse, the method I used at most with low-up or right-left. The code below ta inside…
-
0
votes0
answers52
viewsPlacing CANVAS inside an SVG, is it possible?
I’m trying to create a quiz for visitors to the page to mark where they’re feeling pain in their body. My idea was to generate an area that was possible to draw/paint but that was delimited by the…
-
0
votes0
answers20
viewsAdd star icon to Google Chart Candlestick
I am trying to add a star icon to the Candlestick chart with Google Charts api, but I find it difficult. If anyone can help me: I saw it working on this google page:…
-
0
votes0
answers33
viewsCanvas animation causing serration in images
I created a game, using JS and Canvas, and when the user starts the game, the scenario and its objects begin to move. The animation of it is done through a requestAnimationFrame, which is run…
-
0
votes0
answers39
viewsBirth enemies other than where the player is with Canvas API
I created a small code to illustrate my problem. In this code is drawn a circle (enemy) randomly on the canvas screen every 100ms. But sometimes you end up drawing also where the larger circle is…
-
0
votes0
answers13
viewsProblems using canvas Stroke and filter together
I’m developing an image editor on canvas and it needs to contain filters and a rubber. My problem is: By changing the effect (contrast, saturation and brightness) and after using the rubber, it…
-
0
votes0
answers11
viewsCanva - Fabric JS - Proportional image inside a container
I need to resize the image with width=100% and height=auto inside the Canvas - Fabric JS. I tried several ways, but without success. jQuery $(document).on('change', '#id_universo_imagem',…
-
-1
votes1
answer978
viewsphoto of canvas buggy
The picture doesn’t show anything black or all white. code: <!--Start of Tawk.to Script--> <script type="text/javascript"> var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date();…
canvasasked 7 years ago DenyBanner 1 -
-1
votes1
answer66
viewsCanvas is not appearing
I have a menu of buttons being displayed, and when I click on one of them, some operations happen and then a canvas with text should be displayed. Turns out, these operations all happen, but…
-
-1
votes1
answer78
viewsDisplay qrcode in an alert
I have this code: $("#exemplo1").click(function(){ $('#codigoQrCode').qrcode(JSON.stringify('teste')); //se vcs clicarem aqui, aparecerá o qrcode(canvas) }); $("#exemplo2").click(function(){…
-
-1
votes2
answers167
viewsCheck if canvas is drawn
Hello. I need some function to check if my canvas was designed by the user. The code is as follows:: <canvas id="canvas"> Este navegador não suporta esta função. </canvas> <script…