jeffcoughlin.com

ColdFusion Art? Fun with CF8

After working on the FarCry CFImage plugin for ColdFusion 8 I decided to try something fun. I wanted to see if I could generate a Pacman image in less than 5 minutes.

While doing it I was reminded of the days when ASCII art was fun (for me). Thus the title "ColdFusion Art" (I couldn't combine "CF" and "Art" together without too many childish jokes coming to mind :)).

I'd love to see what others can do with CF8's new image functionality. Can you make ColdFusion Art? ...A cartoon perhaps (hopefully one better than mine :) )? Maybe a comic strip? I don't care if it's based off of your favorite video game or a childhood cartoon memory, but I think it would be a lot of fun to see what people come up with (even if it has no real value).

I don't know about you, but the new image tools in CF8 have really gotten me excited enough to try new things.

view plain print about
1<!--- Create the image variable --->
2<cfset myImage = imageNew("",500,250) />
3<!--- Set the drawing color to yellow. --->
4<cfset ImageSetDrawingColor(myImage,"yellow") />
5<!--- Turn on antialiasing to improve image quality. --->
6<cfset ImageSetAntialiasing(myImage,"on") />
7<!--- Draw Pacman --->
8<cfset ImageDrawArc(myImage,25,25,200,200,30,300,true) />
9<!--- Draw pelets --->
10<cfset ImageDrawArc(myImage,230,105,40,40,0,365,true) />
11<cfset ImageDrawArc(myImage,340,105,40,40,0,365,true) />
12<cfset ImageDrawArc(myImage,450,105,40,40,0,365,true) />
13<!--- Draw the text --->
14<cfset stAtrCollection = structNew() />
15<cfset stAtrCollection.font = "arial" />
16<cfset stAtrCollection.size = 50 />
17<cfset stAtrCollection.style = "bold" />
18<cfset ImageDrawText(myImage,"Pacman",250,50,stAtrCollection) />
19<!--- Display the image in a browser. --->
20<cfimage action="writeToBrowser" source="#myImage#" />

Related Blog Entries

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Adrian Lynch's Gravatar Oh jesus! You've just opened a big ol' can of worms with this!

Fire the designers, the coders can take care of everything :OD
#1 by Adrian Lynch | 12/23/07 5:15 PM



BlogCFC 5.9.8.007 by Raymond Camden | RSS | Contact Blog Owner