Questions tagged as 'canvas'

1
answer

Place background image on HTML canvas

I'm trying to learn a little more about canvas for games in Html5. var canvas;//o elemento canvas sobre o qual desenharemos var ctx;//o "contexto" da canvas que será utilizado (2D ou 3D) var dx = 5;//a tava de variação (velocidade) horiz...
asked by 01.05.2018 / 23:30
1
answer

Javascript - drawRect is interfering with the background color

When I put a square on canvas the background goes white. (function(){ var c = document.createElement("canvas"); var ctx = c.getContext('2d'); var fps = 30; var height = 300; var width = 300; var Bloco = new bloco();...
asked by 16.05.2018 / 00:32
1
answer

Mount a Strobe Light inside the JS canvas

I have a task to develop for college but I have some problems. First let me try to explain what to do: I need to simulate a strobe light based on some colors in an HTML selector. The user must choose the range (I have not done the range ye...
asked by 28.02.2018 / 21:56
1
answer

Angled Bind with Canvas

Good morning, I would like to know if it is possible to bind and / or force the angular bind with the canvas. My problem is this: I'm using the canvas to give a graphical representation of my client and for UI I'm using angular 1.6.2, but whe...
asked by 29.05.2017 / 10:58
2
answers

When I try to make a canvas, it does not do the error but also does nothing

I'd like to know what I'm doing wrong here ... <script type="text/javascript"> function draw() { if (!Modernizr.canvas) return; { var canvas = document.getElementById("mycanvas"); var ctx = canvas.getContext("2d...
asked by 05.05.2017 / 21:49
1
answer

How to use "time" transitions in a Canvas animation

Sequencing the post " How to generate a Sine curve , where I made some adjustments: I am still working on this ECG (electrocardiogram) simulator, and now I need to "manipulate" the times inside the simulator, For example: It takes too long...
asked by 01.12.2016 / 12:04
1
answer

Canvas - draw repeated image

How can I draw an image by repeating until I fill in an area? Something like the effect of CSS property background-repeat . Where the image is repeated until it fills the entire area of the tag.     
asked by 09.11.2016 / 15:59
1
answer

Manipulate an image before adding it to a canvas element

I'm adding an image dynamically to a canvas , but I'm not able to resize it correctly. var img = new Image(); img.src = "http://i.stack.imgur.com/lIaBN.jpg"; function inserir() { var canvas = document.getElementById('meuCanvas...
asked by 30.07.2016 / 06:01
1
answer

Print Content That Has Several Canvas

I'm making a website where you have a painting to color a drawing. After much research I was able to paint a certain area of the canvas drawing. Now I want to do a function that prints the drawing I made. I'm trying to do this:...
asked by 28.10.2015 / 16:48
1
answer

Coloring Canvas Design and Enlarging Painting Area

I have a type of entertainment on a page where I choose a drawing that is placed inside a% color%. I already have the brush and the colors. But I want something that does the bucket function that paints an entire area. Click on the bucket,...
asked by 26.10.2015 / 18:41