Get Shape Effective Properties from Presentations in C++
In this topic, we will discuss effective and local properties. When we set values directly at these levels
- In portion properties on portion’s slide.
- In prototype shape text style on layout or master slide (if portion’s text frame shape has one).
- In presentation global text settings.
then those values are called local values. At any level, local values could be defined or omitted. But finally when it comes to the moment when the application needs to know what the portion should look like it uses effective values. You can get effective values by using GetEffective() method from the local format.
The following example shows how to get effective values.
Get Effective Properties of a Camera
Aspose.Slides for C++ allows developers to get effective properties of the camera. For this purpose, the CameraEffectiveData class has been added in Aspose.Slides. CameraEffectiveData class represents an immutable object which contains effective camera properties. An instance of CameraEffectiveData class is used as part of ThreeDFormatEffectiveData class which is an effective values pair for ThreeDFormat class.
The following code sample shows how to get effective properties for the camera.
Get Effective Properties of a Light Rig
Aspose.Slides for C++ allows developers to get effective properties of Light Rig. For this purpose, the LightRigEffectiveData class has been added in Aspose.Slides. LightRigEffectiveData class represents an immutable object which contains effective light rig properties. An instance of LightRigEffectiveData class is used as part of ThreeDFormatEffectiveData class which is an effective values pair for ThreeDFormat class.
The following code sample shows how to get effective properties for the Light Rig.
Get Effective Properties of a Bevel Shape
Aspose.Slides for C++ allows developers to get effective properties of Bevel Shape. For this purpose, the ShapeBevelEffectiveData class has been added in Aspose.Slides. ShapeBevelEffectiveData class represents an immutable object which contains effective shape’s face relief properties. An instance of ShapeBevelEffectiveData class is used as part of ThreeDFormatEffectiveData class which is an effective values pair for ThreeDFormat class.
The following code sample shows how to get effective properties for the Bevel Shape.
Get Effective Properties of a Text Frame
Using Aspose.Slides for C++, you can get effective properties of Text Frame. For this purpose, the TextFrameFormatEffectiveData class has been added in Aspose.Slides which contains effective text frame formatting properties.
The following code sample shows how to get effective text frame formatting properties.
Get Effective Properties of a Text Style
Using Aspose.Slides for C++, you can get effective properties of Text Style. For this purpose, the TextStyleEffectiveData class has been added in Aspose.Slides which contains effective text style properties.
The following code sample shows how to get effective text style properties.
Get the Effective Font Height Value
Using Aspose.Slides for C++, you can get effective properties of Font Height. Here is the code demonstrating the portion’s effective font height value changing after setting local font height values on different presentation structure levels.
Get the Effective Fill Format for a Table
Using Aspose.Slides for C++, you can get effective fill formatting for different table logic parts. For this purpose, the IFillFormatEffectiveData interface has been added in Aspose.Slides which contains effective fill formatting properties. Please note that cell formatting always has higher priority than row formatting, a row has higher priority than column and column higher that whole table.
So finally CellFormatEffectiveData properties always used to draw the table. The following code sample shows how to get effective fill formatting for different table logic parts.
FAQ
How can I tell that I got a “snapshot” rather than a “live object,” and when should I read effective properties again?
EffectiveData objects are immutable snapshots of computed values at the time of the call. If you change local or inherited settings of the shape, retrieve the effective data again to get the updated values.
Does changing the layout/master slide affect effective properties that have already been retrieved?
Yes, but only after you read them again. An already obtained EffectiveData object does not update itself—request it again after changing the layout or master.
Can I modify values through EffectiveData?
No. EffectiveData is read-only. Make changes in the local formatting objects (shape/text/3D, etc.), and then obtain the effective values again.
What happens if a property is not set at the shape level, nor in the layout/master, nor in global settings?
The effective value is determined by the default mechanism (PowerPoint/Aspose.Slides defaults). That resolved value becomes part of the EffectiveData snapshot.
From an effective font value, can I tell which level provided the size or typeface?
Not directly. EffectiveData returns the final value. To find the source, check local values at the portion/paragraph/text frame and the text styles at the layout/master/presentation to see where the first explicit definition appears.
Why do EffectiveData values sometimes look identical to the local ones?
Because the local value ended up being final (no higher-level inheritance was needed). In such cases, the effective value matches the local one.
When should I use effective properties, and when should I work only with local ones?
Use EffectiveData when you need the “as rendered” result after all inheritance is applied (e.g., to align colors, indents, or sizes). If you need to change formatting at a specific level, modify local properties and then, if needed, re-read EffectiveData to verify the outcome.