Class BaseGraphic
Inheritance
System.Object
BaseGraphic
Assembly: IronPPT.dll
Syntax
public abstract class BaseGraphic : ContentElement, ICloneableElement, IGraphic, IContentElement
BaseGraphic is the shared base every standalone graphic on a slide inherits, the place where size, position, rotation, and flipping are defined once. A developer rarely names it directly; the concrete type to reach for is Image, which derives from it. The base matters because the geometry members below are the same whether the graphic is an image or another standalone graphic, so learning them once covers the family.
Because it is abstract, a graphic is not created as a BaseGraphic; a developer works with a derived type such as Image and then positions and sizes it through the inherited members. A graphic obtained from the slide can be cast or held as BaseGraphic when only the geometry matters, which is why the IGraphic contract it implements describes exactly this shared surface.
Position is the graphic's ElementPosition on the slide, while Width and Height are DocUnit values for its size and Angle is its Rotation. Resize sets width and height together from two integers, and Rotate turns the graphic by a given angle. FlipHorizontal and FlipVertical mirror it across the respective axis. These members move and shape the graphic without touching its content, so an image can be repositioned, resized, rotated, or flipped through the same calls used for any other standalone graphic.
void Place(BaseGraphic graphic)
{
graphic.Resize(400, 300);
graphic.Rotate(15);
}
The manage image how-to covers placing and sizing an image on a slide, the add image example shows one in a worked slide, and the Image reference documents the concrete graphic that derives from this base.
Constructors
BaseGraphic()
Declaration
Properties
Angle
Declaration
public Rotation Angle { get; set; }
Property Value
Height
Declaration
public DocUnit Height { get; set; }
Property Value
Position
Declaration
public ElementPosition Position { get; set; }
Property Value
Width
Declaration
public DocUnit Width { get; set; }
Property Value
Methods
FlipHorizontal()
Declaration
public void FlipHorizontal()
FlipVertical()
Declaration
public void FlipVertical()
Resize(Int32, Int32)
Declaration
public void Resize(int width, int height)
Parameters
| Type |
Name |
Description |
| System.Int32 |
width |
|
| System.Int32 |
height |
|
Rotate(Double)
Declaration
public void Rotate(double angle)
Parameters
| Type |
Name |
Description |
| System.Double |
angle |
|
Implements