Skip to content

Commit 744f900

Browse files
Add Shapes examples
1 parent fb430a9 commit 744f900

File tree

99 files changed

+1545
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+1545
-0
lines changed

slides/english/net/shapes/_index.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: Essential PowerPoint Shape Categories
3+
weight: 10
4+
limit:
5+
description: Explore the diverse shape categories in PowerPoint including lines, rectangles, circles, arrows, and callouts to build your visual vocabulary.
6+
keywords:
7+
url: /net/shapes/
8+
---
9+
{{< blocks/products/pf/main-wrap-class >}}
10+
{{< blocks/products/pf/main-container >}}
11+
{{< blocks/products/pf/tutorial-page-section >}}
12+
13+
## Introduction
14+
15+
Shapes in PowerPoint are versatile design elements that allow presenters to create visually compelling slides with minimal effort. From basic geometric forms to complex custom shapes, these tools enable users to illustrate concepts, create diagrams, highlight information, and enhance overall presentation aesthetics. With advanced formatting options including gradients, shadows, and 3D effects, PowerPoint shapes transform ordinary slides into professional, engaging visual experiences that capture audience attention and reinforce key messages.
16+
17+
PowerPoint's shape functionality extends beyond mere decoration, offering practical applications for data visualization, process flows, and interactive elements. Users can combine shapes to build complex illustrations, convert text to shapes for creative typography, and even animate shapes to bring presentations to life. Whether creating corporate presentations, educational materials, or creative portfolios, mastering PowerPoint's shape tools empowers presenters to communicate more effectively through strategic visual design that complements and strengthens their verbal narrative.
18+
19+
{{< tutorial-card link="./add-arrow-shaped-line/" title="Creating Custom Line Shapes in PowerPoint with Aspose.Slides" imgSrc="./add-arrow-shaped-line/images/thumb.png" >}}
20+
{{< tutorial-card link="./add-stretch-offset-for-image-fill/" title="Adding Images to PowerPoint Slides with Aspose.Slides" imgSrc="./add-stretch-offset-for-image-fill/images/thumb.png" >}}
21+
{{< tutorial-card link="./animations-on-shapes/" title="Creating Animated Text Effects in PowerPoint with Aspose.Slides" imgSrc="./animations-on-shapes/images/thumb.png" >}}
22+
{{< tutorial-card link="./create-group-shape/" title="Create Group Shapes in PowerPoint with Aspose.Slides for .NET" imgSrc="./create-group-shape/images/thumb.png" >}}
23+
{{< tutorial-card link="./create-zoom-frame/" title="Creating Zoom Frames in PowerPoint with Aspose.Slides" imgSrc="./create-zoom-frame/images/thumb.png" >}}
24+
{{< tutorial-card link="./fill-shapes-gradient/" title="Creating Gradient Filled Ellipse Shapes in PowerPoint with Aspose.Slides" imgSrc="./fill-shapes-gradient/images/thumb.png" >}}
25+
{{< tutorial-card link="./fill-shapes-picture/" title="Creating Shapes with Tiled Image Fill in PowerPoint using Aspose.Slides" imgSrc="./fill-shapes-picture/images/thumb.png" >}}
26+
{{< tutorial-card link="./format-lines/" title="Creating a Rectangle Shape with Custom Line Formatting in PowerPoint" imgSrc="./format-lines/images/thumb.png" >}}
27+
{{< tutorial-card link="./formatted-ellipse/" title="Creating Elliptical Shapes in PowerPoint with Aspose.Slides" imgSrc="./formatted-ellipse/images/thumb.png" >}}
28+
{{< tutorial-card link="./geometry-shape-add-segment/" title="Adding Segments to GeometryShape in PowerPoint Presentations" imgSrc="./geometry-shape-add-segment/images/thumb.png" >}}
29+
{{< tutorial-card link="./geometry-shape-remove-segment/" title="Modify Geometry Paths in PowerPoint Shapes with Aspose.Slides" imgSrc="./geometry-shape-remove-segment/images/thumb.png" >}}
30+
{{< tutorial-card link="./rotating-shapes/" title="Creating and Rotating Rectangle Shapes in PowerPoint" imgSrc="./rotating-shapes/images/thumb.png" >}}
31+
{{< tutorial-card link="./shapes-alignment/" title="Aligning and Grouping Shapes in PowerPoint Presentations" imgSrc="./shapes-alignment/images/thumb.png" >}}
32+
{{< tutorial-card link="./tile-picture-fill-format/" title="Create Tiled Image Backgrounds in PowerPoint with Aspose.Slides" imgSrc="./tile-picture-fill-format/images/thumb.png" >}}
33+
34+
{{< /blocks/products/pf/tutorial-page-section >}}
35+
{{< /blocks/products/pf/main-container >}}
36+
{{< /blocks/products/pf/main-wrap-class >}}
37+
38+
{{< blocks/products/products-backtop-button >}}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: Creating Custom Line Shapes in PowerPoint with Aspose.Slides for .NET
3+
weight: 7700
4+
limit:
5+
description: Learn how to create and customize line shapes in PowerPoint presentations using Aspose.Slides for .NET. Apply various formatting options including style, width, dash patterns, arrowheads, and colors.
6+
keywords: [Aspose.Slides, .NET, PowerPoint, Line Shape, Formatting, Arrowheads, Line Style, C#]
7+
url: /net/shapes/add-arrow-shaped-line/
8+
---
9+
{{< blocks/products/pf/main-wrap-class >}}
10+
{{< blocks/products/pf/main-container >}}
11+
{{< blocks/products/pf/tutorial-page-section >}}
12+
13+
# Creating Custom Line Shapes in PowerPoint with Aspose.Slides
14+
15+
Aspose.Slides for .NET provides powerful capabilities for creating and manipulating PowerPoint presentations programmatically. This example demonstrates how to create a customized line shape with various formatting options including line style, width, dash pattern, arrowheads, and color.
16+
17+
With Aspose.Slides, you can easily add professional-looking line shapes to your presentations without requiring Microsoft PowerPoint to be installed on your machine. This is particularly useful for automated report generation or server-side presentation creation.
18+
19+
---
20+
{{< tutorial-widget sourcePath="slides/net/shapes/add-arrow-shaped-line" >}}
21+
22+
{{< /blocks/products/pf/tutorial-page-section >}}
23+
{{< blocks/products/pf/tutorial-page-section >}}
24+
## Installation Instructions
25+
26+
1. Install via NuGet Package Manager:
27+
```
28+
Install-Package Aspose.Slides.NET
29+
```
30+
31+
2. Install via .NET CLI:
32+
```
33+
dotnet add package Aspose.Slides.NET
34+
```
35+
36+
3. Add reference manually:
37+
- Download the latest version from [Aspose Releases](https://releases.aspose.com/slides/net/)
38+
- Add reference to Aspose.Slides.dll in your project
39+
40+
## Additional Resources
41+
42+
- [Aspose.Slides for .NET Documentation](https://docs.aspose.com/slides/net/)
43+
- [Aspose.Slides for .NET API Reference](https://reference.aspose.com/slides/net/)
44+
{{< /blocks/products/pf/tutorial-page-section >}}
45+
{{< /blocks/products/pf/main-container >}}
46+
{{< /blocks/products/pf/main-wrap-class >}}
47+
48+
{{< blocks/products/products-backtop-button >}}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
//ExStart
2+
//ExSummary:This code demonstrates how to create a presentation with a customized line shape. The example shows how to add a line with various formatting options including style, width, dash style, arrowheads, and color.
3+
//ExStepSummary:0:The following code shows how to set up the document directory and ensure it exists:
4+
//ExStepSummary:1:The following code shows how to create a new PowerPoint presentation:
5+
//ExStepSummary:2:The following code shows how to get the first slide and add a line shape:
6+
//ExStepSummary:3:The following code shows how to format the line style and width:
7+
//ExStepSummary:4:The following code shows how to set the dash style for the line:
8+
//ExStepSummary:5:The following code shows how to customize the beginning arrowhead:
9+
//ExStepSummary:6:The following code shows how to customize the ending arrowhead:
10+
//ExStepSummary:7:The following code shows how to set the line color:
11+
//ExStepSummary:8:The following code shows how to save the presentation:
12+
//ExStepImage:2:images/1.png
13+
//ExStepImage:3:images/2.png
14+
//ExStepImage:4:images/3.png
15+
//ExStepImage:5:images/4.png
16+
//ExStepImage:6:images/5.png
17+
//ExStepImage:7:images/6.png
18+
//ExStep:0-
19+
// The path to the documents directory.
20+
string dataDir = "Your Document Directory";
21+
22+
// Create directory if it is not already present.
23+
bool IsExists = System.IO.Directory.Exists(dataDir);
24+
if (!IsExists)
25+
System.IO.Directory.CreateDirectory(dataDir);
26+
27+
//ExStep:1-
28+
// Instantiate PresentationEx class that represents the PPTX file
29+
using (Presentation pres = new Presentation())
30+
{
31+
//ExStep:2-
32+
// Get the first slide
33+
ISlide sld = pres.Slides[0];
34+
35+
// Add an autoshape of type line
36+
IAutoShape shp = sld.Shapes.AddAutoShape(ShapeType.Line, 50, 150, 300, 0);
37+
38+
//ExStep:3-
39+
// Apply some formatting on the line
40+
shp.LineFormat.Style = LineStyle.ThickBetweenThin;
41+
shp.LineFormat.Width = 10;
42+
43+
//ExStep:4-
44+
// Set the dash style for the line
45+
shp.LineFormat.DashStyle = LineDashStyle.DashDot;
46+
47+
//ExStep:5-
48+
// Configure the beginning arrowhead properties
49+
shp.LineFormat.BeginArrowheadLength = LineArrowheadLength.Short;
50+
shp.LineFormat.BeginArrowheadStyle = LineArrowheadStyle.Oval;
51+
52+
//ExStep:6-
53+
// Configure the ending arrowhead properties
54+
shp.LineFormat.EndArrowheadLength = LineArrowheadLength.Long;
55+
shp.LineFormat.EndArrowheadStyle = LineArrowheadStyle.Triangle;
56+
57+
//ExStep:7-
58+
// Set the line color to Maroon
59+
shp.LineFormat.FillFormat.FillType = FillType.Solid;
60+
shp.LineFormat.FillFormat.SolidFillColor.Color = Color.Maroon;
61+
62+
//ExStep:8-
63+
// Write the PPTX to disk
64+
pres.Save(dataDir + "LineShape2_out.pptx", SaveFormat.Pptx);
65+
}
66+
//ExEnd
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: Adding Images to PowerPoint Slides with Aspose.Slides for .NET
3+
weight: 7700
4+
limit:
5+
description: Learn how to load images and add them as picture frames to PowerPoint presentation slides using Aspose.Slides for .NET library. This guide covers creating a presentation, loading images, and saving the result.
6+
keywords: [Aspose.Slides, .NET, PowerPoint, C#, image, picture frame, presentation, slide]
7+
url: /net/shapes/add-stretch-offset-for-image-fill/
8+
---
9+
{{< blocks/products/pf/main-wrap-class >}}
10+
{{< blocks/products/pf/main-container >}}
11+
{{< blocks/products/pf/tutorial-page-section >}}
12+
13+
# Adding Images to PowerPoint Slides with Aspose.Slides
14+
15+
Aspose.Slides for .NET provides powerful capabilities for programmatically creating and modifying PowerPoint presentations. This example demonstrates how to load an external image and add it to a presentation slide as a picture frame - a common requirement when generating reports, creating templates, or building presentations dynamically from data sources.
16+
17+
The code below handles everything from creating a new presentation to adding the image and saving the final PPTX file, all with just a few lines of C# code.
18+
19+
---
20+
{{< tutorial-widget sourcePath="slides/net/shapes/add-stretch-offset-for-image-fill" >}}
21+
22+
{{< /blocks/products/pf/tutorial-page-section >}}
23+
{{< blocks/products/pf/tutorial-page-section >}}
24+
## Installation Instructions
25+
26+
1. Install Aspose.Slides for .NET using one of these methods:
27+
- NuGet Package Manager: `Install-Package Aspose.Slides.NET`
28+
- .NET CLI: `dotnet add package Aspose.Slides.NET`
29+
- Or download directly from [Aspose website](https://releases.aspose.com/slides/net/)
30+
31+
2. Add the namespace to your C# file:
32+
```csharp
33+
using Aspose.Slides;
34+
using Aspose.Slides.Export;
35+
```
36+
37+
## Resources
38+
39+
- [Aspose.Slides for .NET Documentation](https://docs.aspose.com/slides/net/)
40+
- [Aspose.Slides for .NET API Reference](https://reference.aspose.com/slides/net/)
41+
42+
{{< /blocks/products/pf/tutorial-page-section >}}
43+
{{< /blocks/products/pf/main-container >}}
44+
{{< /blocks/products/pf/main-wrap-class >}}
45+
46+
{{< blocks/products/products-backtop-button >}}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
//ExStart
2+
//ExSummary:This code demonstrates how to load an image and add it to a PowerPoint presentation slide as a picture frame. It covers creating directories, instantiating a presentation, loading an image file, and saving the modified presentation.
3+
//ExStepSummary:0:The following code sets up the document directory and creates it if it doesn't exist
4+
//ExStepSummary:1:The following code creates a new PowerPoint presentation and accesses the first slide
5+
//ExStepSummary:2:The following code loads an image from file and adds it to the presentation's image collection
6+
//ExStepSummary:3:The following code adds the image as a picture frame to the slide with specific dimensions
7+
//ExStepSummary:4:The following code saves the presentation to disk in PPTX format
8+
//ExStepImage:3:images/1.png
9+
10+
//ExStep:0-
11+
// The path to the documents directory.
12+
string dataDir = "Your Document Directory";
13+
14+
// Create directory if it is not already present.
15+
bool IsExists = System.IO.Directory.Exists(dataDir);
16+
if (!IsExists)
17+
System.IO.Directory.CreateDirectory(dataDir);
18+
19+
//ExStep:1-
20+
// Instantiate Presentation class that represents the PPTX
21+
using (Presentation pres = new Presentation())
22+
{
23+
// Get the first slide
24+
ISlide sld = pres.Slides[0];
25+
26+
//ExStep:2-
27+
// Instantiate the ImageEx class and load the image from file
28+
IImage img = Images.FromFile(dataDir + "aspose-logo.jpg");
29+
// Add the loaded image to the presentation's image collection
30+
IPPImage imgx = pres.Images.AddImage(img);
31+
32+
//ExStep:3-
33+
// Add Picture Frame with height and width equivalent to the original image
34+
// Position it at coordinates (50, 150) on the slide
35+
sld.Shapes.AddPictureFrame(ShapeType.Rectangle, 50, 150, imgx.Width, imgx.Height, imgx);
36+
37+
//ExStep:4-
38+
// Write the PPTX file to disk
39+
pres.Save(dataDir + "AddStretchOffsetForImageFill_out.pptx", SaveFormat.Pptx);
40+
}
41+
//ExEnd
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
title: Creating Animated Text Effects in PowerPoint with Aspose.Slides for .NET
3+
weight: 7700
4+
limit:
5+
description: Easily add dynamic text animations to your PowerPoint presentations using Aspose.Slides for .NET. Learn how to implement custom motion paths and trigger animations.
6+
keywords: [PowerPoint animations, text animation effects, custom motion path, interactive animations, Aspose.Slides .NET, trigger animations, C# PowerPoint automation]
7+
url: /net/shapes/animations-on-shapes/
8+
---
9+
{{< blocks/products/pf/main-wrap-class >}}
10+
{{< blocks/products/pf/main-container >}}
11+
{{< blocks/products/pf/tutorial-page-section >}}
12+
13+
# Creating Animated Text Effects in PowerPoint with Aspose.Slides
14+
15+
Aspose.Slides for .NET provides powerful capabilities for creating animated text effects in PowerPoint presentations programmatically. This example demonstrates how to create a text box with animation effects, including a custom motion path triggered by a button click. The code creates a presentation with a rectangle shape containing text, applies a PathFootball animation, and adds a custom user-defined motion path that can be triggered interactively.
16+
17+
---
18+
{{< tutorial-widget sourcePath="slides/net/shapes/animations-on-shapes" >}}
19+
20+
{{< /blocks/products/pf/tutorial-page-section >}}
21+
{{< blocks/products/pf/tutorial-page-section >}}
22+
## Installation Instructions
23+
24+
1. Install Aspose.Slides for .NET using one of the following methods:
25+
26+
NuGet Package Manager:
27+
```csharp
28+
Install-Package Aspose.Slides
29+
```
30+
31+
Package Manager Console:
32+
```csharp
33+
PM> Install-Package Aspose.Slides
34+
```
35+
36+
.NET CLI:
37+
```csharp
38+
dotnet add package Aspose.Slides
39+
```
40+
41+
2. Add the required namespaces to your C# code:
42+
```csharp
43+
using Aspose.Slides;
44+
using Aspose.Slides.Animation;
45+
using Aspose.Slides.Export;
46+
using System.Drawing;
47+
```
48+
49+
## Additional Resources
50+
51+
- [Aspose.Slides for .NET Documentation](https://docs.aspose.com/slides/net/)
52+
- [Aspose.Slides for .NET API Reference](https://reference.aspose.com/slides/net/)
53+
54+
{{< /blocks/products/pf/tutorial-page-section >}}
55+
{{< /blocks/products/pf/main-container >}}
56+
{{< /blocks/products/pf/main-wrap-class >}}
57+
58+
{{< blocks/products/products-backtop-button >}}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
//ExStart
2+
//ExSummary:This code demonstrates how to create animated text effects in PowerPoint presentations using Aspose.Slides. It shows the process of creating a text box with animation effects and adding a custom motion path triggered by a button click.
3+
//ExStepSummary:0:The following code shows how to set up the document directory and create it if it doesn't exist:
4+
//ExStepSummary:1:The following code shows how to create a new PowerPoint presentation:
5+
//ExStepSummary:2:The following code shows how to add an auto shape with text and apply a PathFootball animation effect:
6+
//ExStepSummary:3:The following code shows how to create a trigger button and add an interactive sequence:
7+
//ExStepSummary:4:The following code shows how to create a custom user path animation:
8+
//ExStepSummary:5:The following code shows how to define motion path commands for the animation:
9+
//ExStepSummary:6:The following code shows how to save the presentation to disk:
10+
//ExStepImage:5:images/1.png
11+
12+
13+
//ExStep:0-
14+
// The path to the documents directory.
15+
string dataDir = "Your Document Directory";
16+
17+
// Create directory if it is not already present.
18+
bool IsExists = System.IO.Directory.Exists(dataDir);
19+
if (!IsExists)
20+
System.IO.Directory.CreateDirectory(dataDir);
21+
22+
//ExStep:1-
23+
// Instantiate PresentationEx class that represents the PPTX
24+
using (Presentation pres = new Presentation())
25+
{
26+
// Get reference to the first slide
27+
ISlide sld = pres.Slides[0];
28+
29+
//ExStep:2-
30+
// Create a rectangle auto shape with text
31+
IAutoShape ashp = sld.Shapes.AddAutoShape(ShapeType.Rectangle, 150, 150, 250, 25);
32+
33+
// Add text to the shape
34+
ashp.AddTextFrame("Animated TextBox");
35+
36+
// Add PathFootBall animation effect to the shape
37+
pres.Slides[0].Timeline.MainSequence.AddEffect(ashp, EffectType.PathFootball,
38+
EffectSubtype.None, EffectTriggerType.AfterPrevious);
39+
40+
//ExStep:3-
41+
// Create a bevel shape to serve as a trigger button
42+
IShape shapeTrigger = pres.Slides[0].Shapes.AddAutoShape(ShapeType.Bevel, 10, 10, 20, 20);
43+
44+
// Create an interactive sequence for the trigger button
45+
ISequence seqInter = pres.Slides[0].Timeline.InteractiveSequences.Add(shapeTrigger);
46+
47+
//ExStep:4-
48+
// Add a user-defined path effect triggered by clicking the button
49+
IEffect fxUserPath = seqInter.AddEffect(ashp, EffectType.PathUser, EffectSubtype.None, EffectTriggerType.OnClick);
50+
51+
// Get the motion effect behavior from the effect
52+
IMotionEffect motionBhv = ((IMotionEffect)fxUserPath.Behaviors[0]);
53+
54+
//ExStep:5-
55+
// Define the first point in the motion path
56+
PointF[] pts = new PointF[1];
57+
pts[0] = new PointF(0.076f, 0.59f);
58+
motionBhv.Path.Add(MotionCommandPathType.LineTo, pts, MotionPathPointsType.Auto, true);
59+
60+
// Define the second point in the motion path
61+
pts[0] = new PointF(-0.076f, -0.59f);
62+
motionBhv.Path.Add(MotionCommandPathType.LineTo, pts, MotionPathPointsType.Auto, false);
63+
64+
// End the motion path
65+
motionBhv.Path.Add(MotionCommandPathType.End, null, MotionPathPointsType.Auto, false);
66+
67+
//ExStep:6-
68+
// Write the presentation as PPTX to disk
69+
pres.Save(dataDir + "AnimExample_out.pptx", SaveFormat.Pptx);
70+
}
71+
//ExEnd

0 commit comments

Comments
 (0)