Index

PowerDoc Objects

Gradient (As Inverter)

Overview

This objects represents an inverter. In Power Engine API, an inverter is a rectangular surface which, when placed on the page, inverts the color and alpha-channel of the covered area. This object is a special case of the standard gradient.

Designated Rendering Function: pdDrawGradient (14), pdDrawInverter (14)

None

Properties

pdDw (1029)   PD_LONG_SIGNED

Also appears in: PowerFont Record, PowerFont, Library Polyline, Library Shape, Line, Rectangle, Circle/Ellipse, Pattern, Grid, Gradient, Gradient (As Fast Rectangle), 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, Gradient (As Fast Rectangle), 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

Example

C/C++

DT_ID_SLONG obj[1];

obj[0] = pdObjAdd(pd, 0, "Inverter");

/* Properties for object 1 */
pdPropAdd(pd, obj[0], pdDh, "400", PD_LONG_SIGNED);
pdPropAdd(pd, obj[0], pdDw, "400", PD_LONG_SIGNED);


/* Image placement */
pdImgAdd(pd, obj[0], 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("Inverter");

obj_0 + i(pdDh, 400);
obj_0 + i(pdDw, 400);

/* Image Pinning */

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

Index