Questions tagged as 'canvas'

1
answer

Center color gradient of Canvas html5

I have the following gradient on canvas. link My question is: Why, if I set the red to 0.5, does it appear in the middle of the bar? How do I get my color to appear right in the center? How does the gradient system work? LOO...
asked by 29.05.2017 / 17:25
1
answer

Problem when using image in game Pong with JavaScript

I'm trying to adapt a code that I found googling for the Pong game. What I try is to replace the ball drawn by an image of a ball in image. Searching the Internet suggest that you use the following code: var img = new Image(200,200); img.src...
asked by 11.12.2016 / 19:58
1
answer

How to scale images with canvas as background

I try to put a Background in the app, something very simple to learn the use of canvas and bitmaps protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Win...
asked by 12.08.2016 / 18:02
0
answers

Scrollbar does not work in Canvas - Python

I have a problem with a job that I have to do, the question is that I have to open an image and put it on the canvas and if the image is bigger than the canvas I want to be able to move with the scrollbars, the question is that the scrollbars re...
asked by 22.12.2018 / 21:00
1
answer

How to convert image with canvas to base64 using toDataURL?

I would like to know how I can convert to base64 an image that I have stored on my computer that has a url like this (folder / id / img.jpg) So far I have tried this but it does not work for me, when I do the console.log and I see the data pa...
asked by 20.12.2018 / 02:28
0
answers

"Print" Tkinter Canvas in a PDF file

I have a small tool that generates some graphics and I show them in a Canvas. I would like to create a PDF file generated from the canvas, I am trying this solution but it does not work for me: link Is there a library to do what I want?...
asked by 03.12.2018 / 20:18
0
answers

cancelAnimationFrame does not clean my canvas

Inside this canvas <canvas id="canvas" class="canvas" width="300" height="300"></canvas> Have this feature var estado = false; var canvas = document.getElementById('canvas'); var ctx = canvas.getContext("2d"); function frame()...
asked by 30.11.2018 / 21:25
0
answers

graph chart.js

I have this graph, how can I make it change its colors depending on whether the data is less than 50 is red and greater than 50 is blue? var ctx = document.getElementById('chart'); var myChart = new Chart(ctx, { type: 'bar', data: {...
asked by 20.11.2018 / 19:30
0
answers

Delay when displaying photos on canvas

I have to take a list of products where you can see the photos that are in a web directory and so that I stay centered, of the same height, etc ... I need the canvas of the photo with white background be square, for example 250x250px and the pho...
asked by 12.11.2018 / 13:39
0
answers

How to update canvas width and height when resizing image

How can I update the width and heigth of a cava actuamaticamente. What happens is that I have an image to which I resize it, to larger or smaller size and the canvas takes me the original measurement and not the new one that I added to the image...
asked by 09.11.2018 / 20:48