Define Drawing Background


The Define Drawing Background function specifies how the DWF reading application should render the background behind the geometric primitives to be drawn.



Opcode format Opcode Operand Format Comments
Extended ASCII (Background <ws><IR>,<IG>,<IB>,<IA>[<ws>]) 


The background color for the drawing.

The background color index for the drawing.


R, G, B, A Defines a color by the red, green, blue, and alpha intensity components

I Defines a color by an index into the current color map


Before a DWF reading application starts drawing geometric primitives to the viewing window, the window should normally be cleared. The Define Background operation specifies the color to which the viewing window is cleared before drawing begins.

The legal range for the intensity integers is from 0, indicating zero intensity, to 255, indicating full intensity. In some cases, it may be desired to overlay a DWF image on top of an already existing screen image. Consequently, clearing the background is not desired. A zero intensity alpha indicates that the background color is totally transparent, and the window is not cleared. A full intensity alpha (255) indicates that the background color is completely opaque, and the color fully overwrites (clears) its background. Alpha values between 0 and 255 indicate that, when the background is drawn, it is blended to a varying degree with the background image.



A .dwf file should contain a maximum of one occurrence of the background opcode, which by convention should be nested inside a Define Drawing Information Block opcode.



By default the drawing background is fully transparent:

(Background 0,0,0,0)

Implementation in WHIP! Versions

Toolkit Function




Revised in

Define Drawing Background -





See Also

Set Color and Define Drawing Information Block