Index

PowerDoc Objects

Gradient

Overview

This objects represents a standard gradient. In Power Engine API, a gradient is a rectangular surface whose color and/or transparency gradually change from one limit to another according to the specified parameters.

Designated Rendering Function: pdDrawGradient (14)

pdBodyPtr (1013)

Also appears in: Typography (For Outline Fonts), Row Boundary, Typographic Frame, Library Shape, Rectangle, Circle/Ellipse, True Circle/Ellipse, Slice, Pattern, Grid, Custom Shape or Polygon, Gradient (As Fast Rectangle)

Link to the Surface Definition object.

This link supplies style attributes for the body of an object. Style attributes include color, transparency, pattern fills, special effects (e.g. blur, emboss, pattern fill) etc.

pdStylePtr (1002)

Also appears in: Shadow Definition, Line Definition (Full), Outline Definition, Line Definition (Standard), Line Definition (Minimal)

Link to the Surface Definition object.

This link supplies style attributes. Style attributes include color, transparency, pattern fills, special effects (e.g. blur, emboss, pattern fill) etc.

Properties

pdDw (1029)   PD_LONG_SIGNED

Also appears in: PowerFont Record, PowerFont, Library Polyline, Library Shape, Line, Rectangle, Circle/Ellipse, Pattern, Grid, Gradient (As Fast Rectangle), Gradient (As Inverter), Bitmap Image, Library Bitmap Image, 3D Model

In general, this property represents the width of a line, shape or some other object in document units. Most objects assume a positive width. However, some objects (e.g. lines) can have either a positive or a negative width. In these cases, this property also indicates the direction.

This property may also be used for some other more specific purposes. For example, in PowerFonts it refers to the font's base width (or horizontal units per em-square). Similarly, in PowerFont records this property serves as the advance width of a glyph.

Sample values:

500 = Width of 500 document units
-200 = Width of -200 document units

pdDh (1030)   PD_LONG_SIGNED

Also appears in: PowerFont, Library Polyline, Library Shape, Line, Rectangle, Circle/Ellipse, Pattern, Grid, Gradient (As Fast Rectangle), Gradient (As Inverter), Bitmap Image, Library Bitmap Image, 3D Model

In general, this property represents the height of a line, shape or other object in document units. Most objects assume a positive height. But some objects (e.g. lines) can have either a positive or a negative height. In these cases, the height property also indicates the direction.

This property may also be used for some other more specific purposes. For example, in PowerFonts this property refers to the font's base height (or vertical units per em-square).

Sample values:

400 = Height of 400 document units
-100 = Height of -100 document units

pdGradientType (1044)   PD_BYTE_UNSIGNED

Also appears in: Gradient (As Fast Rectangle)

Gradient type.

Supported values:

0 = None (Fast Rectangle)
1 = Horizontal
2 = Vertical
3 = Bi-Horizontal
4 = Bi-Vertical

10 = Quarter-Circular A
11 = Quarter-Circular B
12 = Quarter-Circular C
13 = Quarter-Circular D
14 = Half-Circular A
15 = Half-Circular B
16 = Half-Circular C
17 = Half-Circular D
18 = Circular

20 = Quarter-Diamond A
21 = Quarter-Diamond B
22 = Quarter-Diamond C
23 = Quarter-Diamond D
24 = Half-Diamond A
25 = Half-Diamond B
26 = Half-Diamond C
27 = Half-Diamond D
28 = Diamond

255 = None (Inverter)

Example

C/C++

DT_ID_SLONG obj[3];

obj[0] = pdObjAdd(pd, 0, "Gradient Start Style");
obj[1] = pdObjAdd(pd, 0, "Gradient End Style");
obj[2] = pdObjAdd(pd, 0, "Gradient");

/* Properties for object 0 */
pdPropAdd(pd, obj[0], pdRGBT, "FF000080", PD_HEX);

/* Properties for object 1 */
pdPropAdd(pd, obj[1], pdRGBT, "0000FF80", PD_HEX);

/* Properties for object 2 */
pdLinkAdd(pd, obj[2], pdBodyPtr, obj[0]);
pdLinkAdd(pd, obj[2], pdStylePtr, obj[1]);
pdPropAdd(pd, obj[2], pdDh, "400", PD_LONG_SIGNED);
pdPropAdd(pd, obj[2], pdDw, "400", PD_LONG_SIGNED);
pdPropAdd(pd, obj[2], pdGradientType, "18", PD_BYTE_UNSIGNED);


/* Image placement */
pdImgAdd(pd, obj[2], 0, 50, 50, 0, 0, 0, pdDrawGradient, DV_NULL);

INTEGRAL DSL

/* Lambda shortcuts */

local o = @(label = "") CDTObj(::my.doc, label); /* to make object */
local p = @(id, str, len = PD_DEFAULT) CDTProp(id, str, len); /* to add property - general */
local s = @(id, str) CDTPropStr(id, str); /* to add property - string */
local i = @(id, num) CDTPropInt(id, num); /* to add property - integer */
local l = @(id, obj) CDTLink(id, obj); /* to add link */

/* Objects */

local obj_0 = o("Gradient Start Style");
local obj_1 = o("Gradient End Style");
local obj_2 = o("Gradient");

/* Object Properties */

obj_0 + s(pdRGBT, "FF000080");

obj_1 + s(pdRGBT, "0000FF80");

obj_2 + l(pdBodyPtr, obj_0);
obj_2 + l(pdStylePtr, obj_1);
obj_2 + i(pdDh, 400);
obj_2 + i(pdDw, 400);
obj_2 + i(pdGradientType, 18);

/* Image Pinning */

obj_2.Pin(0, 50, 50, pdDrawGradient);
 

Index