Knowledgebase (2345)
Children categories
Animation is a great way to emphasize important points, to control the flow of information, and to increase viewer interest in your presentation. You can animate text, pictures, shapes, tables, SmartArt graphics, and other objects in PowerPoint slide to give them visual effects. This article will focus on how to apply animation effect to a shape using Spire.Presentation in C#.
Step 1: Initialize an instance of Presentation class and get the first slide from the presentation.
Presentation ppt = new Presentation(); ISlide slide = ppt.Slides[0];
Step 2: Insert a rectangle in the slide and fill the shape with purple.
IAutoShape shape = slide.Shapes.AppendShape(ShapeType.Rectangle, new RectangleF(50, 50, 200, 80)); shape.Fill.FillType = FillFormatType.Solid; shape.Fill.SolidColor.Color = Color.Purple; shape.ShapeStyle.LineColor.Color = Color.White;
Step 3: Apply FadedSwivel animation effect to the shape.
shape.Slide.Timeline.MainSequence.AddEffect(shape, AnimationEffectType.FadedSwivel);
Step 4: Save the file.
ppt.SaveToFile("animations.pptx", FileFormat.Pptx2010);
Output:

Full Code:
using Spire.Presentation;
using Spire.Presentation.Drawing.Animation;
using System.Drawing;
using Spire.Presentation.Drawing;
namespace SetAnimationsOnShapes
{
class Program
{
static void Main(string[] args)
{
Presentation ppt = new Presentation();
ISlide slide = ppt.Slides[0];
IAutoShape shape = slide.Shapes.AppendShape(ShapeType.Rectangle, new RectangleF(50, 50, 200, 80));
shape.Fill.FillType = FillFormatType.Solid;
shape.Fill.SolidColor.Color = Color.Purple;
shape.ShapeStyle.LineColor.Color = Color.White;
shape.AppendTextFrame("Animated Shape");
shape.Slide.Timeline.MainSequence.AddEffect(shape, AnimationEffectType.FadedSwivel);
ppt.SaveToFile("animations.pptx", FileFormat.Pptx2010);
}
}
}
How to Convert PowerPoint Document to TIFF Image in C#, VB.NET
2014-05-16 03:09:57 Written by KoohjiConversion from PowerPoint to TIFF may be useful in order to fax the presentation files or send them off for printing. Spire.Presentation provides straightforward method SaveToFile to do the conversion, which automatically detects presentation slides and convert them to TIFF image (one image per slide).
Step 1: Create an instance of Presentation class.
Presentation ppt = new Presentation();
Step 2: Load a PowerPoint file.
ppt.LoadFromFile("template.pptx");
Step 3: Save to TIFF format file.
ppt.SaveToFile("toTIFF.tiff", FileFormat.Tiff);
Output:

Full Code:
using Spire.Presentation;
namespace PPTtoTIFF
{
class Program
{
static void Main(string[] args)
{
Presentation ppt = new Presentation();
ppt.LoadFromFile("template.pptx");
ppt.SaveToFile("toTIFF.tiff", FileFormat.Tiff);
}
}
}
Imports Spire.Presentation
Namespace PPTtoTIFF
Class Program
Private Shared Sub Main(args As String())
Dim ppt As New Presentation()
ppt.LoadFromFile("template.pptx")
ppt.SaveToFile("toTIFF.tiff", FileFormat.Tiff)
End Sub
End Class
End Namespace
Spire.Presentation for .NET is designed to help .NET developers to create, access, copy and edit PowerPoint documents as well as protect PowerPoint documents. By using Spire.Presentation, developers can save PowerPoint files with write protection to allow the presentation to be read in read only mode. This section aims to provide guidance for how to save PowerPoint documents as ReadOnly using Spire.Presentation component.
To begin with, create or open a .NET class application in Visual Studio 2005 or above versions, add Spire.Presentation.dll to your .NET project assemblies. Then, you are able to set a PPT documents to ReadOnly using the sample demo C# code we have offered below.
Step 1: Create a PPT document
Presentation presentation = new Presentation();
Step 2: Load PPT file from disk
presentation.LoadFromFile(@"..\..\..\..\..\..\Data\sample.pptx");
Step 3: Protect the document with a string password
presentation.Protect("test");
Step 4: Save and preview
presentation.SaveToFile("readonly.pptx", FileFormat.Pptx2007);
System.Diagnostics.Process.Start("readonly.pptx");
Screen effect:

Full code:
//create PPT document
Presentation presentation = new Presentation();
//load PPT file from disk
presentation.LoadFromFile(@"..\..\..\..\..\..\Data\sample.pptx");
//protect the document with password "test"
presentation.Protect("test");
//save the document
presentation.SaveToFile("readonly.ppt", FileFormat.PPT);
System.Diagnostics.Process.Start("readonly.ppt");
'create PPT document
Dim presentation As New Presentation()
'load PPT file from disk
presentation.LoadFromFile("..\..\..\..\..\..\Data\sample.pptx")
protect the document with password "test"
presentation.Protect("test")
'save the document
presentation.SaveToFile("readonly.ppt", FileFormat.PPT)
System.Diagnostics.Process.Start("readonly.ppt")