DynaPDF Manual - Page 178

Previous Page 177   Index   Next Page 179

Function Reference
Page 178 of 839
The way how the bounding box should be calculated is differently for soft masks and transparency
groups which are used stand alone.
Stand alone transparency groups
A stand alone group can be placed on a page like a template. The lower left corner of the bounding
box is typically set to zero, since this corner represents the coordinate origin of the group. The upper
right corner is set to the wished width and height.
It is also possible to create the group larger than necessary and to modify the bounding box with
SetBBox() when the real size is known. The media box represents the bounding box of the group. If
the left and bottom members are set to non-zero values then use PlaceTemplateEx() to place the
group on a page because this function considers the coordinate origin.
Soft masks
The calculation of the bounding box of a soft mask is slightly different because a soft mask is just a
parameter of the graphics state and hence there is no direct way to specify where the mask should
be rendered when it is activated.
The coordinate system in a soft mask is that of the parent object in which the mask is used. This is
no problem so far but this conflicts with the coordinate logic in DynaPDF since no other object is
drawn in this way.
Coordinates and bounding box of a soft mask:
50
300
Media box of the page
Bounding box of the soft mask
x1 = 50
x2 = 350
y1 = 550
y2 = 650
The bounding box of a soft mask can be seen like a clipping rectangle. The left and bottom members
of the bounding box do not change the coordinate origin.
Before creating a soft mask it is usualy best to set SetUseVisibleCoords() to true. This property
moves the coordinate origin into the visible area of the group. Now you can draw objects into the
 

Previous topic: BeginTransparencyGroup, The Group's Bounding Box

Next topic: Isolated and Non-Isolated Groups, Knockout Groups, Color Spaces, How to use a Transparency Group?