Is it possible to get the RGB value pixel under the mouse? Is there a complete example of this? Here's what I have so far:  <script> function draw() {   var ctx = document.getElementById('canvas').getContext('2d');   var i...
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...
In a canvas I created a 2d context. In that context... with a function... I'm able to create some 'circle objects'. Now, what I want, is to get the ImageData of a single circle object instead of the image data of the whole context.  In th...
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...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.