I'm looking to allow users to slice an existing canvas into two canvases in whatever direction they would like.   I know how to allow the user to draw a line and I also know how to copy the image data of one canvas onto two new ones, but how can...
I have a two part question about javascript canvas:  Part 1: I have a .jpg in the same file as my html document. I was wondering if there was a simple way of getting a pixel's color in that file without having to use context.getImageData().    Pa...
I am working with the 'canvas' element, and trying to do some pixel based manipulations of images with Javascript in FIrefox 4.  The following code leaks memory, and i wondered if anyone could help identify what is leaking.  The images used a...
I am painting an image to a HTML canvas and getting image data from it to find the colors of specific pixels. The image is a map where each country is a different color. I want to cross reference the color returned by .getImageData() to a list of col...
Providing you have an array of colors and you want to fill a canvas with its content, the fastest way I'm aware of is:  var my_array = /* already have it */; var img_data = ctx.createImageData(canvas.width, canvas.height); for (var i=0; i<canv...
Background: Over the last week I've been working on a game that is essentially multi-directional Tron, using Canvas and JavaScript. I opted not to clear the Canvas every frame so that my little line segments leave a trail. For collision detection...
When I try to get image data from my png everything works fine on every browser. For most of the users it works also fine. But, on some computers this code  imageData = ctx.getImageData(0, 0, img.width, img.height).data;   returns pixels where some o...
This question has been asked a lot, but I just don't understand why this is happening to me.  Basically, I have a canvas, and an image, and when I try to do this:    var canvas = document.getElementById('somecanvas'); var ctx = canvas.get...
I have this fiddle here: http://jsfiddle.net/R6rGp/  I try to pick up the color of an image/canvas but I always get RGB 000.  But obviously, the image has no real black pixels. What's wrong with that?  document.getElementById("canvas").on...
I have a following problem: when I draw a rectangle (using fillRect method), and then I draw an image (using drawImage), I can't get correct result from Contex, by using getImageData. When I comment line with drawImage, it works correctly. Where...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.