DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations

Trending

  • Top 10 Engineering KPIs Technical Leaders Should Know
  • SRE vs. DevOps
  • Structured Logging
  • How To Use Pandas and Matplotlib To Perform EDA In Python

Trending

  • Top 10 Engineering KPIs Technical Leaders Should Know
  • SRE vs. DevOps
  • Structured Logging
  • How To Use Pandas and Matplotlib To Perform EDA In Python
  1. DZone
  2. Coding
  3. Frameworks
  4. ColdFusion 8's image functions + jQuery= a UI for adding text and color blocks into an image file

ColdFusion 8's image functions + jQuery= a UI for adding text and color blocks into an image file

Brian Swartzfager user avatar by
Brian Swartzfager
·
Mar. 03, 08 · News
Like (0)
Save
Tweet
Share
12.42K Views

Join the DZone community and get the full member experience.

Join For Free

one of the new features in coldfusion 8 is the ability to manipulate images using coldfusion tags and functions. in addition to being to do generic image manipulations (like rotating, resizing, and cropping), you can also add text to an image using the imagedrawtext function, like in this example:


<!---assign the image file to the carimage variable--->
<cfimage name = "carimage" action="read" source="ferrari.gif"/>
<!---add the text "fast car!" to the image and place it 10 pixels from the left and 15 from the top--->
<cfset imagedrawtext(carimage, "fast car!, 10, 15)>
<!---display the new image--->
<cfimage source="#carimage#" action="writetobrowser">

a week ago, an idea popped into my head: "what if you could create a ui tool that would let a user decide what text should appear on the image and where it should appear?" greyhound image with a caption

i decided to try and answer that question. the result: a working proof-of-concept application that lets you add text and blocks of color anywhere on a selected image using a ui tool powered by jquery javascript functions. when you're done manipulating the image, you submit the data defining your changes to coldfusion via an ajax call, and coldfusion creates a new image in temp space based on that data and displays it. you can save the new image down to your computer or store the data you submitted in the database so the image you made can be reproduced without permanently storing a new image file.

the fact that it only took me a week to do this (no more than 25 hours) is a testament to both the power and simplicity of coldfusion and jquery.

you can try out the proof-of-concept at: http://www.swartzfager.org/captionator .

JQuery Blocks

Opinions expressed by DZone contributors are their own.

Trending

  • Top 10 Engineering KPIs Technical Leaders Should Know
  • SRE vs. DevOps
  • Structured Logging
  • How To Use Pandas and Matplotlib To Perform EDA In Python

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: