AlignShapes
内容
[
隐藏
]AlignShapes(ShapesAlignmentType, bool, IBaseSlide)
改变幻灯片上所有形状的放置。将形状对齐到幻灯片的边缘或边缘,或使它们相互对齐。
public static void AlignShapes(ShapesAlignmentType alignmentType, bool alignToSlide,
IBaseSlide slide)
参数 | 类型 | 描述 |
---|---|---|
alignmentType | ShapesAlignmentType | 确定将应用哪种对齐类型。 |
alignToSlide | Boolean | 如果为 true,形状将相对于幻灯片边缘对齐。 |
slide | IBaseSlide | 父幻灯片。 |
示例
示例:
[C#]
using (Presentation pres = new Presentation("pres.pptx"))
{
SlideUtil.AlignShapes(ShapesAlignmentType.AlignBottom, true, pres.Slides);
}
另见
- enum ShapesAlignmentType
- interface IBaseSlide
- class SlideUtil
- namespace Aspose.Slides.Util
- assembly Aspose.Slides
AlignShapes(ShapesAlignmentType, bool, IBaseSlide, int[])
改变幻灯片上所选形状的放置。将形状对齐到幻灯片的边缘或边缘,或使它们相互对齐。
public static void AlignShapes(ShapesAlignmentType alignmentType, bool alignToSlide,
IBaseSlide slide, int[] shapeIndexes)
参数 | 类型 | 描述 |
---|---|---|
alignmentType | ShapesAlignmentType | 确定将应用哪种对齐类型。 |
alignToSlide | Boolean | 如果为 true,形状将相对于幻灯片边缘对齐。 |
slide | IBaseSlide | 父幻灯片。 |
shapeIndexes | Int32[] | 要对齐的形状索引。 |
示例
示例:
[C#]
using (Presentation pres = new Presentation("pres.pptx"))
{
ISlide slide = pres.Slides[0];
IShape shape1 = slide.Shapes[0];
IShape shape2 = slide.Shapes[1];
SlideUtil.AlignShapes(ShapesAlignmentType.AlignBottom, false, pres.Slides[0], new int[]
{
slide.Shapes.IndexOf(shape1),
slide.Shapes.IndexOf(shape2)
});
}
另见
- enum ShapesAlignmentType
- interface IBaseSlide
- class SlideUtil
- namespace Aspose.Slides.Util
- assembly Aspose.Slides
AlignShapes(ShapesAlignmentType, bool, IGroupShape)
改变组形状内所有形状的放置。将形状对齐到幻灯片的边缘或边缘,或使它们相互对齐。
public static void AlignShapes(ShapesAlignmentType alignmentType, bool alignToSlide,
IGroupShape groupShape)
参数 | 类型 | 描述 |
---|---|---|
alignmentType | ShapesAlignmentType | 确定将应用哪种对齐类型。 |
alignToSlide | Boolean | 如果为 true,形状将相对于幻灯片边缘对齐。 |
groupShape | IGroupShape | 父组形状。 |
示例
示例:
[C#]
using (Presentation pres = new Presentation("pres.pptx"))
{
SlideUtil.AlignShapes(ShapesAlignmentType.AlignLeft, false, (GroupShape)slide.Shapes[0]);
}
另见
- enum ShapesAlignmentType
- interface IGroupShape
- class SlideUtil
- namespace Aspose.Slides.Util
- assembly Aspose.Slides
AlignShapes(ShapesAlignmentType, bool, IGroupShape, int[])
改变组形状内所选形状的放置。将形状对齐到幻灯片的边缘或边缘,或使它们相互对齐。
public static void AlignShapes(ShapesAlignmentType alignmentType, bool alignToSlide,
IGroupShape groupShape, int[] shapeIndexes)
参数 | 类型 | 描述 |
---|---|---|
alignmentType | ShapesAlignmentType | 确定将应用哪种对齐类型。 |
alignToSlide | Boolean | 如果为 true,形状将相对于幻灯片边缘对齐。 |
groupShape | IGroupShape | 父组形状。 |
shapeIndexes | Int32[] | 要对齐的形状索引。 |
示例
示例:
[C#]
using (Presentation pres = new Presentation("pres.pptx"))
{
SlideUtil.AlignShapes(ShapesAlignmentType.AlignLeft, false, (GroupShape)slide.Shapes[0], new int[] { 0, 2 });
}
另见
- enum ShapesAlignmentType
- interface IGroupShape
- class SlideUtil
- namespace Aspose.Slides.Util
- assembly Aspose.Slides