Liveworksheets is a website for students and teachers where teachers can upload files with questions then after uploading the file the teacher answers these questions and then send this file to students -without answers of course- to answer it. There are many ways that can teacher use to solve these questions but the way that matters to me is the
Tag: html5-canvas
Get canvas pixel position from mouse coordinates
I have a 16×16 canvas that is scaled with CSS (width:90%; height: auto;) and I’m attempting to convert mouse coordinates on the canvas to one of the 16×16 pixels. I’m taking it from an onmousemove event, and while I can get the raw screen coordinates, I need to get where it lies on the canvas. Answer Try this: So you
How to solve this canvas fillStyle problem?
As far as I know it should print big black circle in the middle of the canvas and on top of that a red small circle. But it just prints a big red circle. I just can’t figure it out. Answer Just like @Teemu points out in the comment “Begin the paths” you must use the ctx.beginPath() between your arcs
Scrolling issue with Canvas style.left/top
I am making a magnifying glass for a canvas application but ive run into an issue with scrolling. Essentially the goal is to take a canvas and when an image is added (in this case a cgm image) and make a snapshot of it, scale it up and draw it on to a second smaller canvas that overlays it and
create image in React from backend dataURL
I’m trying to get a snapshot of HTML canvas like so: which seems to be working, and connected properly to the database. But I can’t figure out how to use the dataURL to create an image component on the React frontend I’m able to fetch them from the backend just fine and log the dataURL. I guess I’m just not
Draw isocele triangle according to angle in javascript canvas
I would like to know how can I draw an isocele triangle in canvas, if I know the first angle, and the lengths of the two equal side. Shema (known lengths are in red) And second question, is it possible to curve the top side like that : Shema Answer
Clear canvas by JavaScript
I am using this jQuery plugin to make free drawing over a canvas. I want to clear the canvas for redrawing but after I do and when I click inside canvas for redrawing the old drawing that I cleared appears again Answer This plugin stores all the drawing commands in an actions array, and at each redraw it will go
HTML canvas not producing image from web cam
I want to capture image every time socket.on(‘takePic’) gets triggered. It works fine for the first time. but when the socket.on(‘takePic’) gets triggered second time,the canvas div is just blank and so the img tag. I have copied the takePicture() function from somewhere and added the setInterval() and localstream variable to stop camera. how can I fix this? here is
How can I check if a symbol/MC is a child of another symbol/MC?
I’m using Adobe Animate HTML5 Canvas. EaselJS would also apply. How can I check if a symbol/MC is a child of another symbol/MC? So a symbol/MC is added as a child of lensParentLeft in the following. I then want to check if it is a child of that parent in a later function: The later function being the following, probably
Memory Leak when Drawing Video to Canvas using requestAnimationFrame
I am trying to do a dual monitor screen recording by combining screen1 and screen2 in Canvas. I am using vue and electron to do this. But I always got a memory leak, after I troubleshoot my code and narrow the problem. I found that this simple code causes a memory leak, but until now I could not find out