ImageAddBorder()
Adds a rectangular border around the outside edge of an image.
Requires Extension: Image Extension for Jakarta EE (Lucee 7+)
ImageAddBorder( image=any, thickness=number, color=string, borderType=string );
Returns: void
| Argument | Description | Default |
|---|---|---|
|
image
any,
required
|
edit
The image on which this operation is performed. Alias: name |
|
|
thickness
number,
optional
|
edit
Thickness of the border in pixels. The default value is 1. The border is added to the outside edge of the image; the image area is increased accordingly. |
1 |
|
color
string,
optional
|
edit
Optional. Border color. The default border color is black. See Usage. Only valid if the borderType is not specified or if borderType = "constant". Alias: colour |
black |
|
borderType
string,
optional
|
edit
The type of border:
Alias: type, border |
constant |
Examples
editimg=imageRead("https://avatars1.githubusercontent.com/u/10973141?s=280&v=4")
imageAddBorder(img,10,"red");
cfimage(action="writeToBrowser", source=img);
See also
- Image manipulation
- image.addBorder()
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)