Skip to content

Commit 1dca3b9

Browse files
Merge pull request #115 from SivaSF4550/master
ES-930188- Add the sample Add-animation-effect-to-PowerPoint-image-shape-test
2 parents 8ef1b4a + adac703 commit 1dca3b9

File tree

5 files changed

+90
-0
lines changed

5 files changed

+90
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.12.35707.178 d17.12
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Animate-textbox-shape-image", "Animate-textbox-shape-image\Animate-textbox-shape-image.csproj", "{EDC9B890-A25A-4E92-A9F8-B82F4C6C4CFE}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{EDC9B890-A25A-4E92-A9F8-B82F4C6C4CFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{EDC9B890-A25A-4E92-A9F8-B82F4C6C4CFE}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{EDC9B890-A25A-4E92-A9F8-B82F4C6C4CFE}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{EDC9B890-A25A-4E92-A9F8-B82F4C6C4CFE}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<RootNamespace>Animate-textbox-shape-image</RootNamespace>
7+
<ImplicitUsings>enable</ImplicitUsings>
8+
<Nullable>enable</Nullable>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Syncfusion.Presentation.Net.Core" Version="*" />
13+
</ItemGroup>
14+
<ItemGroup>
15+
<None Update="Data\Image.jpeg">
16+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
17+
</None>
18+
<None Update="Output\.gitkeep">
19+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
20+
</None>
21+
</ItemGroup>
22+
23+
24+
</Project>
84.1 KB
Loading

Animations/Animate-textbox-shape-image/.NET/Animate-textbox-shape-image/Output/.gitkeep

Whitespace-only changes.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
using Syncfusion.Presentation;
2+
3+
//Create an instance for PowerPoint
4+
IPresentation pptxDoc = Presentation.Create();
5+
//Add a blank slide to Presentation
6+
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank);
7+
8+
IShape textboxShape = slide.AddTextBox(200, 50, 150, 50);
9+
IParagraph paragraph = textboxShape.TextBody.AddParagraph();
10+
//Adds a TextPart to the paragraph
11+
ITextPart textPart = paragraph.AddTextPart();
12+
//Adds text to the TextPart
13+
textPart.Text = "Hello World!";
14+
//Access the animation sequence to create effects
15+
ISequence sequence = slide.Timeline.MainSequence;
16+
//Add bounce effect to the shape
17+
IEffect bounceEffect = sequence.AddEffect(textboxShape, EffectType.Bounce, EffectSubtype.None, EffectTriggerType.WithPrevious);
18+
19+
20+
IShape textboxShape1 = slide.AddTextBox(200, 150, 150, 50);
21+
//Adds paragraph to the textbody of textbox
22+
IParagraph paragraph1 = textboxShape1.TextBody.AddParagraph();
23+
//Adds a TextPart to the paragraph
24+
ITextPart textPart1 = paragraph1.AddTextPart();
25+
//Adds text to the TextPart
26+
textPart1.Text = "New Textbox Added";
27+
//Access the animation sequence to create effects
28+
ISequence sequence1 = slide.Timeline.MainSequence;
29+
//Add bounce effect to the shape
30+
IEffect bounceEffect1 = sequence1.AddEffect(textboxShape1, EffectType.Swivel, EffectSubtype.None, EffectTriggerType.WithPrevious);
31+
32+
33+
FileStream pictureStream = new FileStream(@"Data\Image.jpeg", FileMode.Open);
34+
//Adds the picture to a slide by specifying its size and position.
35+
IPicture picture = slide.Pictures.AddPicture(pictureStream, 200, 250, 300, 200);
36+
//Access the animation sequence to create effects
37+
ISequence sequence2 = slide.Timeline.MainSequence;
38+
//Add bounce effect to the shape
39+
IEffect bounceEffect2 = sequence2.AddEffect(picture as IShape, EffectType.Bounce, EffectSubtype.None, EffectTriggerType.WithPrevious);
40+
41+
42+
//Save the PowerPoint Presentation as stream
43+
FileStream outputStream = new FileStream(@"Output\Sample.pptx", FileMode.Create);
44+
pptxDoc.Save(outputStream);

0 commit comments

Comments
 (0)