Solutions 131
Solutions 131
Solution
Check whether there is a selection suite (for example, IStrokeAttributeSuite) that you can use. If nothing is
selected, calling a selection suite changes defaults (the graphics state).
Related APIs
IGraphicStateUtils
IGraphicStyleAttributeBossList
IStrokeAttributeSuite
Solution
Follow the procedure in “Applying graphic attributes to the active selection” or “Applying one graphic
attribute to page items”.
Alternatively, to fill arbitrary page items, use utilities and commands as follows:
2. The graphic attribute boss class kGraphicStyleFillRenderingAttrBoss represents the fill associated with
a graphic page item in the layout. This boss class aggregates the interface IPersistUIDRefData (with
interface identifier of IID_IPERSISTUIDDATA), which holds the UID of the fill color.
3. The command boss aggregates an IPMUnknownData interface. This needs to be populated with a
reference to an attribute boss object created in the previous step. Fill in other information of the
command data with IApplyRendObjAttrCmdData. You also can get the command filled with
command data by using the utility method IGraphicAttributeUtils::CreateFillRenderingCommand or
IGraphicStateUtils::CreateGfxApplyOverrideCommand, passing in rendering class ID, rendering UID,
and attribute boss class ID (in this case, kGraphicStyleFillRenderingAttrBoss).