Mike Chambers

code = joy

Example : Creating spiral designs with Canvas, JavaScript and EaselJS

with one comment

I have been having fun playing around with JavaScript, the HTML5 Canvas element and EaselJS lately, and have been building a lot of small experiments. I wanted to share a simple one I created, which creates spiral designs.

 

 

The example was pretty simple to put together, but is fun to play with, and can make some pretty nice patterns / spirals. I have uploaded a couple of images that I have created using the example:
Read the rest of this entry »

Written by mikechambers

February 9th, 2011 at 12:20 am

Posted in General

Tagged with , , , ,

PixelFlow : EaselJS / Canvas Dynamic Graphics Example

with 7 comments

If you have happen to have been watching my Flickr feed for the past week or two, you have probably noticed that I have been playing around with creating some graphics using Canvas and EaselJS. What started as a simple EaselJS experiment, quickly morphed into an excuse to build a mini app / example and play around with some of the new HTML5 and CSS3 features.

PixelFlow

 

The example I created (named PixelFlow) is a simple example / app that allows you to choose an image, and then create some designs using the colors from the image. The core drawing functionality is built about the HTML5 canvas element and the EaselJS library. It also leverages CSS3 transitions and transformation for animating the UI elements (loading and unloading).

You can play around with the example yourself at:
Read the rest of this entry »

Written by mikechambers

February 2nd, 2011 at 10:54 pm

Posted in General

Tagged with , , , , , , ,

Detecting Canvas.toDataURL Support in Browsers

with 2 comments

I am wrapping up a code example that uses the Canvas.toDataURL API to save canvas data to an image. I am almost done, and was doing a final round of browser testing when I noticed that my example wasnt working on my Android based Google Nexus One Device (2.2.2). After some debugging, and then Googling, I discovered that the Canvas.toDataURL API is not implemented on Android (you can view the bug report here).

Well, after some cursing, I put together a simple method for detecting whether the API is supported on any particular device. I wanted to share it in case anyone else might run into a need for it. So, here it is:
Read the rest of this entry »

Written by mikechambers

February 1st, 2011 at 5:09 pm

Posted in General

Tagged with , ,

Setting the background color when generating images from Canvas.toDataURL

without comments

One of the cool features of the HTML5 canvas element is the toDataURL method. This returns a Base64 encoded image in the form of a data url string. Among other things, this can be displayed directly within an IMG element on the page, or sent to the server so the image can be saved.

However, one thing that I found out this weekend is that there is no background color for the image returned from toDataURL. Looking at the actual canvas draft specification, I found this:
Read the rest of this entry »

Written by mikechambers

January 31st, 2011 at 1:37 pm

Posted in General

Tagged with , , ,

EaselJS / Canvas Generative Graphics Flickr Set

with 4 comments

Just a quick note, but I have created a Flickr set which contains some of the generative graphics I have been creating using canvas, JavaScript and EaselJS.

You can view the set here.

I havent released all of the code used to create all of the examples, but I will release the code / examples as I finish them. Ill post new images on the set whenever I create something I think is interesting.

Written by mikechambers

January 26th, 2011 at 2:36 pm

Posted in General

Tagged with , ,

Layering Multiple Canvas Elements using JavaScript and EaselJS

without comments

If you run my EaselJS Drone Follow example from yesterday on any non-Android / iOS computer / device, you may notice that a graphic is drawn between the mouse touch point and the current position of the drone. This is done by managing and drawing to two canvas elements and is provided to help make it clear what the drone is following (your mouse) and which direction it is currently heading.

Why use two canvas elements, instead of just drawing to one? Well, there are two primary reasons I architected the example like this.
Read the rest of this entry »

Written by mikechambers

January 25th, 2011 at 12:54 pm

EaselJS / Canvas Example : Follow Drone

with 9 comments

As I posted the other day, I have been spending some time playing around with dynamic drawing with the HTML5 Canvas element and EaselJS. I have put together quite a few examples and experiments and will be posting them (along with what I learned from them) over the next couple of weeks.

The first example I want to share is a simple one which I call “follow”. It basically uses EaselJS to create a snake like shape that follows you mouse. Here is a screen shot of a graphic I created with it:

 

Here is an inline version of the example that you can play with. Just click to toggle whether the drone follows your mouse (requires a browser with support for the HTML5 Canvas element).
Read the rest of this entry »

Written by mikechambers

January 24th, 2011 at 1:00 pm

Getting Started with the Canvas Element and EaselJS

with 22 comments

One of the features of HTML5 that developers are most excited about is the Canvas element. The Canvas element essentials provides a bitmap canvas for dynamically rendering shapes and bitmap graphics. It is very similar to the Flash Player’s Bitmap and BitmapData classes.

However, working with the Canvas element can be difficult, especially if you need to manage, update and or / animate multiple shapes and bitmaps. Unlike the Flash Player, the Canvas element does not have a concept of a display list or individual items to render. Instead, it provides a single Canvas on which to draw, and it is up to the developer to determine what needs to be rendered and when.

Grant Skinner has release a JavaScript library named EaselJS, which attempts to provide a Flash like DisplayList API in order to make it easier to work with the Canvas element. The library is just an alpha release, but is surprisingly full featured at this early stage. If you are interested in experimenting with the Canvas API, this is a great way to get started.
Read the rest of this entry »

Written by mikechambers

January 19th, 2011 at 3:48 pm

Posted in General

Tagged with , , ,

Update on Flash and iPhone development

with 12 comments

As you have probably heard, Apple has updated the terms of their developer program license. In particular, section 3.3.1 has been revised and now allows developers to develop applications with a wider array of tools and technologies, including Flash CS5.

We have posted some more information on this on the Adobe Conversations blog. Speaking about the packager for iphone included in Flash CS5:
Read the rest of this entry »

Written by mikechambers

September 10th, 2010 at 8:59 am

Posted in General

Tagged with ,

Accelerate : Flash / Arduino Based Speed Detector

with 17 comments

Well, as you may have noticed from my blog posts the past week or two, I have been playing around with Flash and Arduino. I have a ton of ideas and projects in mind, but wanted to start on something that wouldn’t be too overwhelming, and would give me a good opportunity to learn the basics. Well, I have finished my first project, and wanted to share it with everyone. It is a Flash / Arduino based speed detector with clients for Mac, Windows and Android based devices (via Adobe AIR 2.5 beta).

I have put together a quick video that shows the app in action:
Read the rest of this entry »

Written by mikechambers

August 11th, 2010 at 10:06 pm

Posted in General

Tagged with , ,