RE: CFIMAGE- stacking images

2008-01-30 Thread Daniel Baughman
I see, what I was missing was definitely the functions. I am use to
CF_Magicktag. I can't say I expected Ben Forta to respond to my message!
That function works great for the appending, thank you.

- Dan


-Original Message-
From: Ian Skinner [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 29, 2008 1:24 PM
To: CF-Talk
Subject: Re: CFIMAGE- stacking images


Ben Forta wrote:
 ImageNew() to create a new blank image. ImageRead() and ImagePaste() to
 paste first image, then another ImageNew() and ImagePaste() setting the x
 and y so that it is where you want it relative to first image. Or just
take
 all of that and make a ImageAppend() function that dos it for you.

 --- Ben
   
An important point to get out of this is that the cfimage... tag is
for basic day-in and day-out image tasks.  If one needs more power the
image functions are where they are at.  They can be combined in many
powerful ways.







~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297742
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: CFIMAGE- stacking images

2008-01-29 Thread Ben Forta
ImageNew() to create a new blank image. ImageRead() and ImagePaste() to
paste first image, then another ImageNew() and ImagePaste() setting the x
and y so that it is where you want it relative to first image. Or just take
all of that and make a ImageAppend() function that dos it for you.

--- Ben


-Original Message-
From: Daniel Baughman [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 29, 2008 2:14 PM
To: CF-Talk
Subject: CFIMAGE- stacking images

Hello all,

I keep trying to find ways to use CFIMAGE but almost every time am forced to
use another tool...

Is there any way to append images?  IE I have one image, a photo, that I
want to append a polaroid-like bottom to. It seems this is outside the
functionality of the CFIMAGE tag.  Or am I missing something?

- Dan




~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297671
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


CFIMAGE- stacking images

2008-01-29 Thread Daniel Baughman
Hello all,

I keep trying to find ways to use CFIMAGE but almost every time am forced to
use another tool...

Is there any way to append images?  IE I have one image, a photo, that I
want to append a polaroid-like bottom to. It seems this is outside the
functionality of the CFIMAGE tag.  Or am I missing something?

- Dan


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297670
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: CFIMAGE- stacking images

2008-01-29 Thread Ian Skinner
Ben Forta wrote:
 ImageNew() to create a new blank image. ImageRead() and ImagePaste() to
 paste first image, then another ImageNew() and ImagePaste() setting the x
 and y so that it is where you want it relative to first image. Or just take
 all of that and make a ImageAppend() function that dos it for you.

 --- Ben
   
An important point to get out of this is that the cfimage... tag is
for basic day-in and day-out image tasks.  If one needs more power the
image functions are where they are at.  They can be combined in many
powerful ways.





~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297675
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: CFIMAGE- stacking images

2008-01-29 Thread Raymond Camden
Good point Ian. That's exactly what I tell folks as well. About the
only thing I think the tag can do that the functions can't is the
writeToBrowser action. Of course, CAPTCHA Is a _heck_ of a lot easier
with the tag.

On Jan 29, 2008 2:23 PM, Ian Skinner [EMAIL PROTECTED] wrote:
 Ben Forta wrote:
  ImageNew() to create a new blank image. ImageRead() and ImagePaste() to
  paste first image, then another ImageNew() and ImagePaste() setting the x
  and y so that it is where you want it relative to first image. Or just take
  all of that and make a ImageAppend() function that dos it for you.
 
  --- Ben
 
 An important point to get out of this is that the cfimage... tag is
 for basic day-in and day-out image tasks.  If one needs more power the
 image functions are where they are at.  They can be combined in many
 powerful ways.





 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297678
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: CFIMAGE- stacking images

2008-01-29 Thread Ben Forta
Here's an ImageAppend() function for you. Pass it two image paths, and the
3rd Boolean flag is TRUE (default) to stack images on top of each other, or
FALSE to have them side by side. It returns an image object which you can
save, or write to the browser with cfimage action=writetobrowser.

--- Ben

cffunction name=ImageAppend returntype=any output=yes
cfargument name=image1 type=string required=yes
cfargument name=image2 type=string required=yes
cfargument name=vertical type=boolean required=no
default=TRUE

!--- Local vars ---
cfset var resultImage=
cfset var img1=ImageRead(ARGUMENTS.image1)
cfset var img2=ImageRead(ARGUMENTS.image2)
cfset var imgHeight=0
cfset var imgWidth=0
cfset var img2x=0
cfset var img2y=0

!--- Calculate size of new image ---
cfif ARGUMENTS.vertical
!--- Height is sum of both heights ---
cfset imgHeight=ImageGetHeight(img1)+ImageGetHeight(img2)
!--- Width is greater of the two widths ---
cfset imgWidth=ImageGetWidth(img1)
cfif ImageGetWidth(img2) GT imgWidth
cfset imgWidth=ImageGetWidth(img2)
/cfif
!--- Location of second image ---
cfset img2x=0
cfset img2y=ImageGetHeight(img1)
cfelse
!--- Width is sum of both widths ---
cfset imgWidth=ImageGetWidth(img1)+ImageGetWidth(img2)
!--- Height is greater of the two heights ---
cfset imgHeight=ImageGetHeight(img1)
cfif ImageGetHeight(img2) GT imgHeight
cfset imgHeight=ImageGetHeight(img2)
/cfif
!--- Location of second image ---
cfset img2x=ImageGetWidth(img1)
cfset img2y=0
/cfif

!--- Next create new image ---
cfset resultImage=ImageNew(, imgWidth, imgHeight)

!--- Paste first image ---
cfset ImagePaste(resultImage, img1, 0, 0)

!--- Paste second image ---
cfset ImagePaste(resultImage, img2, img2x, img2y)

cfreturn resultImage
/cffunction




-Original Message-
From: Ben Forta [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 29, 2008 2:18 PM
To: CF-Talk
Subject: RE: CFIMAGE- stacking images

ImageNew() to create a new blank image. ImageRead() and ImagePaste() to
paste first image, then another ImageNew() and ImagePaste() setting the x
and y so that it is where you want it relative to first image. Or just take
all of that and make a ImageAppend() function that dos it for you.

--- Ben


-Original Message-
From: Daniel Baughman [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 29, 2008 2:14 PM
To: CF-Talk
Subject: CFIMAGE- stacking images

Hello all,

I keep trying to find ways to use CFIMAGE but almost every time am forced to
use another tool...

Is there any way to append images?  IE I have one image, a photo, that I
want to append a polaroid-like bottom to. It seems this is outside the
functionality of the CFIMAGE tag.  Or am I missing something?

- Dan






~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297673
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4