Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 1129

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using Web Elements and External Objects
3
Invoke the class with required parameters.
The following example shows a section of a PHP page that adds a border to an image:
$input = new AddBorder();
//Fill in the class fields of $input to match your business logic
$input->serviceusername = "myuser";
$input->servicepassword = "mypassword";
$input->source = "http://myPHPSite/Images/image.jpg";
$input->thickness = "30";
$input->color = "blue";
$input->bordertype = "";
// call the operation
$response = $proxy->AddBorder($input);
In this code snippet,
is the user name set in the ColdFusion administrator with the permission to access the specific
serviceusername
service being requested.
is the password set for the service user name.
servicepassword
is the source URL of the image in the PHP server.Other attributes are the same as the
source
ColdFusion function.
Batch operation on Image:
The following code performs multiple operations on an uploaded image such as
and add a border to it.
$input = new batchOperation();
//TODO: fill in the class fields of $input to match your business logic
//Crop
$element1 = new Element();
$element2 = new Element();
$element3 = new Element();
$element4 = new Element();
$elementArray1 = new ArrayOf_xsd_anyType();
$element1->key = 'x';
$element1->value = '10';
$element2->key = 'y';
$element2->value = '10';
$element3->key = 'width';
$element3->value = '200';
$element4->key = 'height';
$element4->value = '200';
$elementArray1->item[0] = $element1;
$elementArray1->item[1] = $element2;
$elementArray1->item[2] = $element3;
$elementArray1->item[3] = $element4;
$ElementcollectionCrop = new Elementcollection();
$ElementcollectionCrop->key = 'Crop';
$ElementcollectionCrop->value = $elementArray1;
//AddBorder
$element5 = new Element();
$element6 = new Element();
Last updated 1/20/2012
ImageAddborder()
to crop an image
batchOperation()
1124

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents