html5-canvas

Three.js canvas.toDataURL sometimes blank

淺唱寂寞╮ 提交于 2020-06-12 06:49:27
问题 I'm trying to render a THREE.js scene + some overlaid HTML elements using html2canvas.js. It works most times , but not all the time. In the failure cases, the HTML elements are rendered (the background, overlays, etc.) but nothing else. The THREE.js scene acts as if it's completely empty, even though it visibly has data in it. I can say that it usually fails for larger models, but only early into the rendering. It does eventually work in all cases, but the larger models take about 30 seconds

Javascript canvas object gets stuck after rotating with ctx.Rotate()

落爺英雄遲暮 提交于 2020-06-01 06:03:09
问题 I'm trying to make a car game that rotates the car everytime you press an arrow key. I've created the car, but everytime I try to rotate it with ctx.Rotate, the car gets stuck after moving it a specific point. It's as if the whole canvas was rotated with the car. Car won't move anymore to the right. Here is my code for rotating then drawing the car: ctx.translate((canvas.width/2) - 50, (canvas.height/2) - 50); ctx.rotate(90*Math.PI/180); ctx.translate((-canvas.height.width/2) + 50, (-canvas

How to retrieve data from HTML canvas using python?

丶灬走出姿态 提交于 2020-05-25 08:55:20
问题 I am new of web scraping and for one of the project I am working on, I need to retrieve data of bitcoin transactions over time from an interactive chart (https://bitinfocharts.com/comparison/bitcoin-transactions.html) using Python 2.7. I found that all the data I want is hidden in the 855x455 canvas instead of directly in the html file. However, I could find those data in Page source in the form of [new Date("2018/02/18"),159333]]. Why is that? And how can I scrape those data? Appreciate for

How to retrieve data from HTML canvas using python?

穿精又带淫゛_ 提交于 2020-05-25 08:55:13
问题 I am new of web scraping and for one of the project I am working on, I need to retrieve data of bitcoin transactions over time from an interactive chart (https://bitinfocharts.com/comparison/bitcoin-transactions.html) using Python 2.7. I found that all the data I want is hidden in the 855x455 canvas instead of directly in the html file. However, I could find those data in Page source in the form of [new Date("2018/02/18"),159333]]. Why is that? And how can I scrape those data? Appreciate for

How to retrieve data from HTML canvas using python?

南楼画角 提交于 2020-05-25 08:54:28
问题 I am new of web scraping and for one of the project I am working on, I need to retrieve data of bitcoin transactions over time from an interactive chart (https://bitinfocharts.com/comparison/bitcoin-transactions.html) using Python 2.7. I found that all the data I want is hidden in the 855x455 canvas instead of directly in the html file. However, I could find those data in Page source in the form of [new Date("2018/02/18"),159333]]. Why is that? And how can I scrape those data? Appreciate for

Create webm video blob from series of ArrayBuffer

ぐ巨炮叔叔 提交于 2020-05-24 05:07:48
问题 Here's my code to capture video stream and encode to webm (Using https://github.com/GoogleChromeLabs/webm-wasm): async function captureWebm() { console.log("Started webm capture") worker.postMessage("./webm-wasm.wasm"); await nextEvent(worker, "message"); console.log('webm worker loaded') worker.postMessage({ width: w, height: h, timebaseNum: 1, timebaseDen: 30, bitrate: 1500, realtime: true }); let encodeWebm = async function() { mCtx.drawImage(player, 0, 0, w, h); const imageData = mCtx

HTML5 Canvas javascript smudge brush tool

爱⌒轻易说出口 提交于 2020-05-24 04:25:07
问题 I need idea how i can make brush who can color smudge. Example in picture: right side painting with basic brush with two different colors in left also painting but additional use smudge tool, the result should be something like left side I need advice how i can try to do it 回答1: You will need to manipulate pixels to achieve a smudge effect. You can get the pixel information from the canvas using context.getImageData . As the user moves an imaginary brush over existing pixels, you can mimic

How to find the coordinates of the buttons on a canvas, and click on them after using Java and Selenium?

不问归期 提交于 2020-05-21 07:12:19
问题 I have an online calculator that i want to automate some operations for, like subtraction, division, etc. but the thing is that there are no elements since it is a canvas app calculator (link below). I'm wondering how can i click the buttons so im able to automate some operations? The online calculator im trying to automate: https://www.online-calculator.com/full-screen-calculator/ The canvas HTML code <canvas id="canvas" width="335" height="434" style="position: absolute; display: block;

ChartJs, How can I get different color fills between my two datasets in a line graph?

≡放荡痞女 提交于 2020-05-17 05:56:29
问题 Above is a graph I made using ChartJS. I have two datasets. I also have the space between the two datasets filled just like I want it. But I need to get two different colors for the fill. When the Hours dataset is bigger than the Goal dataset, I want the fill to be green, and when the Hours dataset is smaller than Goal, I want it to be red. I'm really hoping there is a way to do this using ChartJS, so that I don't have to recreate this in Canvas. If it matters, this is in Vue.Js. Here is the

Balls bouncing off of each other

末鹿安然 提交于 2020-05-13 14:32:26
问题 I am working on this script where I have x-number bouncing balls (in this case 20 balls) in a canvas. My question is, how do I make them bounce off each other when they hit, as well as bounce off the yellow rectangle when they hit it? var mycanvas =document.getElementById("mycanvas"); var ctx=mycanvas.getContext("2d"); var w=500,h=500; mycanvas.height=h; mycanvas.width=w; var ball=[]; function Ball(x,y,r,c,vx,vy){ this.x=x; //starting x coordinate this.y=y; //starting x coordinate this.r=r; /