Class Bevel
Represents a bevel effect applied to an object or text in a Word document.
Inheritance
Namespace: IronWord.Models
Assembly: IronWord.dll
Syntax
public class Bevel : Object
Giving a shape's edge a raised, three-dimensional profile in a Word document runs through Bevel. It describes the chamfer applied along the top or bottom edge of a shape, the formatting that makes a button or callout look embossed rather than flat. A developer styling shapes for a polished document reaches for it when a plain outline is not enough and the edge should catch light.
A bevel attaches to a shape's 3D formatting, so it is configured as part of building that shape rather than on its own. Set the profile and the depth once, and the edge renders with that effect wherever the shape appears.
PresetProfileType chooses the bevel shape from the BevelPresetTypeValues options, picking the geometry of the raised edge from profiles such as Circle, Angle, Convex, and SoftRound. Height and Width set the depth of the effect, and because measurements in Word can be expressed in several units, the SetHeight and SetWidth methods take both a value and a MeasurementUnit so the depth is unambiguous. GetHeight and GetWidth read those values back in a chosen MeasurementUnit, which is convenient when the value was set in one unit and you need it in another.
Prefer the SetHeight and SetWidth methods over assigning the raw Height and Width properties whenever the unit matters, since the methods record the value with its unit rather than a bare number. A MeasurementUnit of Point suits fine edge depths, while Millimeter or Inch reads more naturally for larger shapes. Keep the height and width modest relative to the shape; an oversized bevel can overwhelm the shape's face. Build the bevel up first, then attach it to the shape's 3D formatting as part of styling that shape.
using IronWord.Models;
using IronWord.Models.Enums;
var bevel = new Bevel();
bevel.PresetProfileType = BevelPresetTypeValues.Circle;
bevel.SetHeight(5, MeasurementUnit.Point);
bevel.SetWidth(5, MeasurementUnit.Point);The glow text effect how-to, the shadow text effect how-to, and the text outline effect how-to show related shape and text effects in context.
Constructors
Bevel()
Declaration
public Bevel()
Properties
Height
Gets or sets the height of the bevel effect.
Declaration
public double Height { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Remarks
The height is specified in points (1/72 inch).
PresetProfileType
Gets or sets the PresetProfileType of the bevel effect.
Declaration
public BevelPresetTypeValues PresetProfileType { get; set; }
Property Value
| Type | Description |
|---|---|
| BevelPresetTypeValues |
Width
Gets or sets the width of the bevel effect.
Declaration
public double Width { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Remarks
The width is specified in points (1/72 inch).
Methods
GetHeight(MeasurementUnit)
Gets the height of the bevel effect in the specified measurement unit.
Declaration
public double GetHeight(MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| MeasurementUnit | measurementUnit | The measurement unit to convert the height to. |
Returns
| Type | Description |
|---|---|
| System.Double | The height of the bevel effect. |
GetWidth(MeasurementUnit)
Gets the width of the bevel effect in the specified measurement unit.
Declaration
public double GetWidth(MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| MeasurementUnit | measurementUnit | The measurement unit to convert the width to. |
Returns
| Type | Description |
|---|---|
| System.Double | The width of the bevel effect. |
SetHeight(Double, MeasurementUnit)
Sets the height of the bevel effect to the specified value in the specified measurement unit.
Declaration
public void SetHeight(double height, MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | height | The height of the bevel effect. |
| MeasurementUnit | measurementUnit | The measurement unit of the specified height. |
SetWidth(Double, MeasurementUnit)
Sets the width of the bevel effect to the specified value in the specified measurement unit.
Declaration
public void SetWidth(double width, MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | width | The width of the bevel effect. |
| MeasurementUnit | measurementUnit | The measurement unit of the specified width. |