Index

C/C++ Functions

dtOutputSetStyleEffects

DT_SWORD dtOutputSetStyleEffects(DT_DTENGINE engine, const DT_STYLE_EFFECTS* style, DT_UBYTE reserved)

Short Description: Set Output style (advanced version)

This function supplies style to the Output of the specified Standard Engine instance. Style is a set of style properties that are applied to output primitives (glyphs/characters, shapes, bitmaps) during rendering. These properties are: color, transparency and various special effects such as shadow, glow, pattern fill, emboss, blur, emboldening etc. All these properties can be defined using the DT_STYLE_EFFECTS structure.

dtOutputSetStyleEffects is an advanced version of the dtOutputSetStyleAttribs function. It uses the DT_STYLE_EFFECTS structure, which allows several style effects to be combined and applied to an output primitive (glyph, character, shape, bitmap) at the same time. It also allows certain style effects to use multiple effect parameters (e.g. Gaussian blur with a different amount of blur in the horizontal and vertical direction). In every other respect, this function behaves the same as dtOutputSetStyleAttribs.

Parameters

ParameterDescription

engine

Handle of the previously created Standard Engine instance.

style

A valid pointer to the DT_STYLE_EFFECTS structure. This structure contains the style to be associated with the Output of the specified Standard Engine instance.

reserved

Reserved for future use. Must be set to 0.

Return Value

If successful, the return value is 1. Otherwise, the function returns 0.

Comments

See dtOutputSetStyleAttribs.

Example 1

DT_STYLE_EFFECTS style = {3, {DV_EFFECT_EDGE_100_NE, 15, 1}, {0, 0, 0, 0}, DV_NULL};

/*
   The above initialization is the same as

   style.effects_len = 3;
   style.effects_arr[0] = DV_EFFECT_EDGE_100_NE;
   style.effects_arr[1] = 15;
   style.effects_arr[2] = 1;
   style.rgbt[0] = 0;
   style.rgbt[1] = 0;
   style.rgbt[2] = 0;
   style.rgbt[3] = 0;
   style.palette = DV_NULL;
*/ 

dtOutputSetStyleAttribs(engine, &style, 0);

Output of glyph M using the above style:

M

Example 2

DT_STYLE_EFFECTS style = {5, {/*first effect*/ DV_EFFECT_EDGE_100_NE, 15, 1, /*second effect*/ DV_EFFECT_PATTERN_STRIPES, 6}, {0, 0, 0, 0}, DV_NULL};

/*
   The above initialization is the same as

   style.effects_len = 5;
   //first effect
   style.effects_arr[0] = DV_EFFECT_EDGE_100_NE;
   style.effects_arr[1] = 15;
   style.effects_arr[2] = 1;
   //second effect
   style.effects_arr[3] = DV_EFFECT_PATTERN_STRIPES;
   style.effects_arr[4] = 6;
   style.rgbt[0] = 0;
   style.rgbt[1] = 0;
   style.rgbt[2] = 0;
   style.rgbt[3] = 0;
   style.palette = DV_NULL;
*/ 

dtOutputSetStyleAttribs(engine, &style, 0);

Output of glyph M using the above style:

M

Example 3

DT_STYLE_EFFECTS style = {3, {DV_EFFECT_HVBLUR_FUZZY, 5, 10}, {0, 48, 178, 200}, DV_NULL};

/*
   The above initialization is the same as

   style.effects_len = 3;
   style.effects_arr[0] = DV_EFFECT_HVBLUR_FUZZY;
   style.effects_arr[1] = 5;
   style.effects_arr[2] = 10;
   style.rgbt[0] = 0;
   style.rgbt[1] = 48;
   style.rgbt[2] = 178;
   style.rgbt[3] = 200;
   style.palette = DV_NULL;
*/ 

dtOutputSetStyleAttribs(engine, &style, 0);

Output of glyph M using the above style:

M

Example 4

DT_STYLE_EFFECTS style = {2, {DV_EFFECT_PATTERN_PHOTO, 22}, {0, 48, 178, 200}, DV_NULL};

/*
   The above initialization is the same as

   style.effects_len = 2;
   style.effects_arr[0] = DV_EFFECT_PATTERN_PHOTO;
   style.effects_arr[1] = 22;
   style.rgbt[0] = 0;
   style.rgbt[1] = 48;
   style.rgbt[2] = 178;
   style.rgbt[3] = 200;
   style.palette = DV_NULL;
*/ 

dtOutputSetStyleAttribs(engine, &style, 0);

Output of glyph M using the above style:

M

Example 5

DT_STYLE_EFFECTS style = {5, {/*first effect*/ DV_EFFECT_HVBLUR_FUZZY, 5, 10, /*second effect*/ DV_EFFECT_PATTERN_PHOTO, 22}, {0, 48, 178, 200}, DV_NULL};

/*
   The above initialization is the same as

   style.effects_len = 5;
   //first effect
   style.effects_arr[0] = DV_EFFECT_HVBLUR_FUZZY;
   style.effects_arr[1] = 5;
   style.effects_arr[2] = 10;
   //second effect
   style.effects_arr[3] = DV_EFFECT_PATTERN_PHOTO
   style.effects_arr[4] = 22;
   style.rgbt[0] = 0;
   style.rgbt[1] = 48;
   style.rgbt[2] = 178;
   style.rgbt[3] = 200;
   style.palette = DV_NULL;
*/ 

dtOutputSetStyleAttribs(engine, &style, 0);

Output of glyph M using the above style:

M

Example 6

DT_STYLE_EFFECTS style = {5, {/*first effect*/ DV_EFFECT_PATTERN_PHOTO, 22, /*second effect*/ DV_EFFECT_HVBLUR_FUZZY, 5, 10}, {0, 48, 178, 200}, DV_NULL};

/*
   The above initialization is the same as

   style.effects_len = 5;
   //first effect
   style.effects_arr[0] = DV_EFFECT_PATTERN_PHOTO
   style.effects_arr[1] = 22;
   //second effect
   style.effects_arr[2] = DV_EFFECT_HVBLUR_FUZZY;
   style.effects_arr[3] = 5;
   style.effects_arr[4] = 10;
   style.rgbt[0] = 0;
   style.rgbt[1] = 48;
   style.rgbt[2] = 178;
   style.rgbt[3] = 200;
   style.palette = DV_NULL;
*/ 

dtOutputSetStyleAttribs(engine, &style, 0);

Output of glyph M using the above style:

M

 

Index