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.
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
<!--- Create the image variable --->
<cfset myImage = imageNew("",500,250) />
<!--- Set the drawing color to yellow. --->
<cfset ImageSetDrawingColor(myImage,"yellow") />
<!--- Turn on antialiasing to improve image quality. --->
<cfset ImageSetAntialiasing(myImage,"on") />
<!--- Draw Pacman --->
<cfset ImageDrawArc(myImage,25,25,200,200,30,300,true) />
<!--- Draw pelets --->
<cfset ImageDrawArc(myImage,230,105,40,40,0,365,true) />
<cfset ImageDrawArc(myImage,340,105,40,40,0,365,true) />
<cfset ImageDrawArc(myImage,450,105,40,40,0,365,true) />
<!--- Draw the text --->
<cfset stAtrCollection = structNew() />
<cfset stAtrCollection.font = "arial" />
<cfset stAtrCollection.size = 50 />
<cfset stAtrCollection.style = "bold" />
<cfset ImageDrawText(myImage,"Pacman",250,50,stAtrCollection) />
<!--- Display the image in a browser. --->
<cfimage action="writeToBrowser" source="#myImage#" />
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#" />
Fire the designers, the coders can take care of everything :OD