Questions tagged as 'canvas'

1
answer

Get element without id

I have div , and within it a canvas without id and other elements . <div id="itens"> ... <canvas></canvas> ... </div> How can I get canvas using JQuery ?     
asked by 20.08.2015 / 16:31
1
answer

Riding an arena on canvas

I'm building an arena using resources of HTML/JS with canvas . I have the following code: function montarArena() { var canvas; var heightCanvas = 498; var widthCanvas = 598; var qtdLinhas = $('#larguraCa...
asked by 28.07.2016 / 07:28
1
answer

Can you calculate the diagonal on Canvas?

I need to draw a square with Canvas in an image. This image comes from the database, where it has different dimensions. I am able to draw the square in the center of the image, but if the image is wider, the Canvas is out of proportion. Is it po...
asked by 24.06.2015 / 15:56
1
answer

Fade Radial js or canvas

Hello, I wonder if there is any transition I can make in radial or ink style dissolving (as if it were dripping ink)? For that purpose it will be cooler to open the site. Fiddle: link $(document).ready(function () { $...
asked by 10.06.2015 / 00:02
2
answers

Fit image inside the canvas

I have a page that allows you to insert an image inside the canvas element and it works perfectly. Now, what I need is a way to limit the positioning of the image inside the canvas, not allowing any remaining white space, regardless of the po...
asked by 28.06.2017 / 16:16
2
answers

Location of a point within the range of an arc

I'm looking for a Javascript function that returns a random value within a range in the area of a circle. The interval would be along the radius with distances equivalent to the center point and the radius endpoint, also considering a range of d...
asked by 21.01.2015 / 18:27
2
answers

Is it possible to mirror an image horizontally (flip) with Canvas?

I know it's possible to mirror a <img> horizontally with CSS, but wanted to know if it is possible to mirror an image horizontally within a canvas . With CSS, I would do so: #img-flip{ transform: scaleX(-1); }...
asked by 03.05.2018 / 21:17
1
answer

How to insert a watermark in PNG

Following this example, I would like to be able to use a png in place of the banners on the canvas: link I'm using this code as a study, because it's all commented out, so my question applies to exactly this code: /* @preserve *...
asked by 23.09.2015 / 00:25
2
answers

Modifying Canvas in real time

How can I use the tag canvas of HTML5 and make this change in real time as I enter the data in input ? I already made form and put tag canvas on the page. I would like to know if in%% of% it is possible to change the...
asked by 23.04.2015 / 17:49
1
answer

JavaScript canvas builder

I'm having a question when creating a button builder for Canvas in JS, I can already detect the click in the button area, but I would like to simplify the code with a constructor, to streamline my process content, but I have no idea how to do it...
asked by 04.12.2015 / 18:45