workflow ImageTestWf;
function atomic main() as int {
var ctx = image->create(400, 400, 3);
ctx.fileName = "test.png";
var text as imagetext;
text.text = "Hello world";
text.fontSize = 60;
text.transparency = 0.5;
text.rotation = 45;
image->drawText(ctx, text);
return image->save(ctx);
}
function create(width as int, height as int, format as int) as imagecontext
Creates an image.
function createBarcode(barcode as imgbarcode, outputName as string, contentCode as int) as int
Renders an image of a barcode and returns its storage file key.
method drawBarcode(img as imagecontext, barcode as imgbarcode)
Draws a barcode on an image.
method drawImage(dest as imagecontext, src as imagecontext, drawCtx as imgdraw, transparency as decimal)
Draws the source image on the destination image using draw variables present in drawCtx and transparency.
method drawText(img as imagecontext, text as imagetext)
Draws text on an image.
function open(storageFileKey as int) as imagecontext
Opens an image.
function openAtVersion(storageFileKey as int, storageFileVersion as int) as imagecontext
Opens an image.
function save(img as imagecontext) as int
Saves an image.
function scanBarcodes(storageFileKey as int) as list of imgbarcode
Scans the image for barcodes.
function scanBarcodesAtVersion(storageFileKey as int, storageFileVersion as int) as list of imgbarcode
Scans the image for barcodes.
function update(img as imagecontext, storageFileKey as int) as int
Updates an image.
Since 1.7.0
| Property | Type | Description |
|---|---|---|
| text | string | watermark text |
| fontName | string | defaults to “Arial“ |
| fontSize | int | |
| transparency | decimal | values between 0 and 1 |
| red | int | RGB 0..255 |
| green | int | RGB 0..255 |
| blue | int | RGB 0..255 |
| fontIsBold | boolean | defaults to false |
| fontIsItalic | boolean | defaults to false |
| left | decimal | |
| right | decimal | |
| top | decimal | |
| bottom | decimal | |
| rotation | int | rotation measured in degrees |
Since 1.7.0
| Property | Type | Description |
|---|---|---|
| storageFileKey | int | defaults to 0 |
| storageFileVersion | int | defaults to -1 |
| transparency | decimal | values between 0 and 1 |
| rotation | decimal | rotation measured in degrees |
Since 1.7.0
| Property | Type | Description |
|---|---|---|
| width | decimal | |
| height | decimal | |
| red | int | 0-255 |
| green | int | 0-255 |
| blue | int | 0-255 |
| codeType | int | See Code Types |
| code | string | |
| left | decimal | |
| right | decimal | |
| top | decimal | |
| bottom | decimal | |
| rotation | int | rotation measured in degrees |
0 - AZTEC1 - CODABAR2 - CODE_393 - CODE_934 - CODE_1285 - DATA_MATRIX6 - EAN_87 - EAN_138 - ITF9 - MAXICODE10 - PDF_41711 - QR_CODE12 - RSS_1413 - RSS_EXPANDED14 - UPC_A15 - UPC_E16 - UPC_EAN_EXTENSIONSince 1.7.0
| Property | Type | Description |
|---|---|---|
| left | decimal | |
| right | decimal | |
| top | decimal | |
| bottom | decimal | |
| rotation | int | rotation measured in degrees |
Since 1.7.0
| Property | Type | Description |
|---|---|---|
| fileName | string | |
| format | int | See Supported formats |
0 - image/bmp1 - image/jpeg2 - image/webp3 - image/png4 - image/gif5 - image/tiff