canvas

importing image on canvas html5

var img = new Image(); img.src = '/images/backdrop.jpg'; ctx.drawImage(img,0,0); I wanted to load an image from local disk on to canvas using dialog box mechanism rather than the path directly specified as in above eg. I tried different sorts using javascript but in vain,even tried using the input type as file. what else can i try? ...

Javascript + Firebug console.log(), how to not get exceptions?

Hi everybody, I'm writing a javascript / HTML5 canvas library to provide basic GUI elements for web audio applications. There's a little demo script that creates widgets with the library and assemble them in a GUI. You can find it @ http://bitterspring.net/webshifter/ The problem is, it seems to work correctly on Chrome and on Firefox ...

Simple Multiplayer game in Ruby on Rails?

Hi guys, I have created a simple card game in Ruby on Rails+ajax with jQuery for animation. It's working Ok, and I wanted to develop a multiplayer version. It looks like it's not so simple as i thought. I have also tryed to port the game completely to JS into the Canvas tag. This is possible for me and I could make the animation there ...

Android: is it possible to have multiple separate Canvas layers, which I can merge to one?

Is it possible to have multiple separate Canvas layers, which I can merge to one? Similar to what I'd do in photoshop? Update: Some explanation why I'd like to have something like that: Layer1 might hold something that has been created by a complex and CPU expensive algorithm while the other layer, Layer2, is something that just goes...

How to draw animation on a canvas ?(android)

I am trying to show an animation on a canvas when user touches to the screen.I know basics and how to draw a bitmap on to canvas but i couldn't find anything good on drawing or showing animation on canvas.i will use frame by frame animation and it will appear at the same position user touched that is why i can't use ImageView. ...

BMP decoding in JavaScript and drawing to Explorer Canvas

I need to download a BMP with JavaScript and render it to the screen, in Internet Explorer. First off, yes, I know this is insane, I'm not going to get into why, let's just accept for a moment that img src is not working because of security constraints, but an ajax request with the proper authentication in the post will pull back the im...

Combining two images on one canvas in HTML5

I'm working with the HTML5 canvas element. Let's say I have 2 ImageData objects that I want to combine to be able to put on one canvas. Lets assume that I don't care how these images combine. Both ImageData objects have the exact same pixel count and shape. What's the best way to combine the two images? I figure that I can write a for ...

How to export SWF as HTML5 Canvas on Flash Professional CS5 ?

Hey there, I have Flash CS5 on my computer but didn't find the way to export swf as HTML5 Canvas.. any help? ...

How can I save div as image at client side where div contains one or more than one HTML5 canvas elements?

Div 'canvasesdiv' element contains three HTML5 canvases. <div style="position: relative; width: 400px; height: 300px;" id="canvasesdiv"> <canvas width="400" height="300px" style="z-index: 1; position: absolute; left: 0px; top: 0px;" id="layer1" /> <canvas width="400" height="300px" style="z-index: 2; position: absolute; left: 0p...

Ajax calls to the server from canvas tag?

Hi, I have a rails server that has a page with canvas tag containing some images and user interface. Some objects inside the canvas have on mouse click events assigned. I wonder if it's possible to execute ajax calls on clicking the item then processing some data inside the ruby on the rails server and comeback to canvas changing some o...

canvas library for drawing images

HTML5 canvas provides lots of flexibility to draw images using javascript. We need to generate javascript code based on inputs from the user (say something like 10 balls of blue color, 5 squares of green color and of a certain size ...). Is there an library which provides appropriate Javascript API(s) so that it is easier to generate the...

fillText is not working in the Safari 3.

I am using HTML5 fillText method of canvas in my coding.It is working file in IE6+,but it was not working in the Mozilla 3.0, then I have tried with mozMeasureText , after that it is working in mozilla 3.0, but now fillText is not working in the Safari 3+. Is there any solution or patch for the Safari 3+. ...

HTML5 canvas: Same code outputs different results in different browsers

In a simple canvas test I created for performance and quality measurement purposes, a canvas is painted with randomised colors and images during an unlimited period. A sample is shown here: http://litterific.com/minisite/ Warning: Only open this in Opera or Chrome, the script is pretty heavy can hang up on slow computers, don't le...

Create 2d context *without* canvas

I am currently looking for a way to create a canvas 2d rendering context without actually having a canvas element on the page. I could dynamically create a canvas element and hide it, but then again I don't want to show the image directly to the user anytime, so there's no point of actually having a canvas element in the page. So I'm bas...

How to harness HTML 5 Canvas with editing tool on iPad

Hey guys, So my company is trying to experiment with enabling an "Autodesk WS-like" (http://www.autocadws.com/mobile) interface though our tool. Our tool has a lot of the same ideas, lay something out, change properties, etc. So the basics of the application seem like they would be very similar. We think it was done with a healthy am...

Merging pixels to minimize paint operations on Html canvas

Hi I'm painting an image onto a canvas (html5) and I want to reduce the number of fillRect calls I'm making in the hope of making the process more efficient. Note: I'm calling canvas.fillRect to paint individual pixels and pixels can be 1x1 or other size rectangle depending on resolution I'm painting in (So I know that they are not call...

Delphi 6 : Alphablending works between sub-image and main Canvas, but not between sub-images

I have a Delphi 6 application where I have an array of TBitmaps each containing an image (sub-image) that was created by making a call to FillRect() with clWhite to flood the TBitmap's Canvas with white, followed by a call toTextOut() to print some text to the Bitmap's Canvas. I have a timer that updates the main Canvas, which belongs...

Delphi 6: TImage Width and Height properties report wrong values?

I'm having a fairly strange problem with a TImage component's width and height properties. As a test, I draw a red dot in (what is supposed to be) the center of the TImage component by taking the midpoint of the TImage's width and height and drawing the dot there so that it is centered (centerPoint2D is a TPoint): // The center point i...

Delphi 6: Can native Delphi do smooth graphics like Flash?

I have a native Delphi TFrame that emulates Roy Tanck's Cumulus Tag Cloud viewer, a WordPress Flash plug-in. What that plug-in does is create a 3D sphere of words that spin around on the surface of a "virtual" sphere. You can see it in action here: http://www.roytanck.com/2008/03/06/wordpress-plugin-wp-cumulus-flash-based-tag-cloud/ ...

HTML5 canvas advanced framework

Hi, I need HTML5 canvas framework to do: draw object (e.g. rectangle) on onmouseover event of the object change color/border style on click do some js action thx EDIT: I have finally decided to use raphaeljs (alternative would be dojo). This framework is awesome. (It doesn't need HTML5 canvas and uses SVG) ...