Feb
10
by Mike Fleming at 7:20 am (2 Comments) ColdFusion
I have not had a chance to play around with every piece of functionality with the image functions that were released in ColdFusion 8. Due to a problem yesterday, I had the chance to play around with a couple of them last evening. The problem was I needed all the images on the site to be the same size. These images are uploaded by the user, so not all of them had the same beginning dimensions. Just resizing them with a height and width would have caused a great number of them to become distorted. So we then decided to start with a base image of a fixed size, resize the uploaded image to a standard width, then overlay that image with the base image. So in the end we have images that are all the exact same size, with our uploaded image looking nice and centered within the base image.
So the first attempt I looked into using the overlay function.
This doesn’t work too bad, but notice that the overlay function will always place the image over your second image aligned to the top. The function has no options for centering or telling it where you want to place the image. A coworker then came across the ImagePaste function, which you can tell it where to place the image using x and y coordinates. With a little math you can figure out the y coordinate to center the image.
You can view a demo of the code here. It shows you the output of each image. Do note that for this example I used a gray background for the base image, just for a visual reference of the image size. The base image I really used was white and was 200×200 in size, so the image appears fixed in that space. Also, a lot of the code here came straight from the example code in the documentation, with a few changes and additions.
Maira Schmalz
August 30, 20106:23 pm
Fed up with getting low amounts of useless traffic to your website? Well i want to let you know about a fresh underground tactic which makes myself $900 each day on 100% AUTOPILOT. I really could be here all day and going into detail but why dont you just check their website out? There is really a excellent video that explains everything. So if your seriously interested in producing hassle-free hard cash this is the site for you. Auto Traffic Avalanche
Cuc Evansky
August 31, 201011:24 am
Sick and tired of getting low amounts of useless visitors for your site? Well i wish to let you know about a new underground tactic that produces myself $900 on a daily basis on 100% AUTOPILOT. I possibly could be here all day and going into detail but why dont you merely check their website out? There is a great video that explains everything. So if your seriously interested in producing simple hard cash this is the site for you. Auto Traffic Avalanche