Index

PowerDoc Objects

Background Surface

Overview

This object represents an infinitely large background surface.

Designated Rendering Function: pdDrawBackground (31)

None

Properties

pdRGBT (1001)   PD_HEX

Also appears in: Surface Definition, System Guide

Color and transparency (4 bytes)

The first three bytes specify the intensity of red (R), green (G) and blue (B) while the last byte specifies the transparency level (T). All values are in the 0-255 range. The value 0 means minimum intensity, 255 means maximum intensity.

The length of this field, when converted to the binary format, is precisely 4 bytes.

Sample values:

"00 00 00 00" (0, 0, 0, 0) = Fully Black, Fully Opaque
"00 00 00 7F" (0, 0, 0, 127) = Fully Black, 50% Transparent
"FF 00 00 00" (255, 0, 0, 0) = Fully Red, Fully Opaque
"00 FF 00 7F" (0, 255, 0, 127) = Fully Green, 50% Transparent
"FF FF FF FF" (255, 255, 255, 255) = Fully White, Fully Transparent
"00 7F 00 00" (0, 127, 0, 0) = 50% Green, Fully Transparent
"7F 7F 7F 7F" (127, 127, 127, 127) = Gray, 50% Transparent

Example

C/C++

DT_ID_SLONG obj[1];

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

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

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

/* Object Properties */

obj_0 + s(pdRGBT, "B4961400");

/* Image Pinning */

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

Index