ImageCollection / PPImage — Aspose.Slides FOSS for .NET API Reference
The ImageCollection class manages all images embedded in a presentation, accessed via Presentation.Images. Each image is represented by a PPImage object.
The Image class implements IImage and IDisposable, used for saving image data.
publicclassImage:IImage,IDisposable
Properties
Property
Type
Access
Description
Size
Size
Read
Image dimensions.
Width
int
Read
Width in pixels.
Height
int
Read
Height in pixels.
Methods
Method
Description
Save(string filename)
Save to a file.
Save(string filename, string format)
Save in a specific format (e.g., "png").
Save(Stream stream, string format)
Save to a stream.
Dispose()
Release resources.
Usage Examples
Add an Image to a Slide
usingAspose.Slides.Foss;usingAspose.Slides.Foss.Export;usingvarprs=newPresentation();usingvarstream=File.OpenRead("logo.png");varimage=prs.Images.AddImage(stream);prs.Slides[0].Shapes.AddPictureFrame(ShapeType.Rectangle,50,50,200,150,image);Console.WriteLine($"Images in presentation: {prs.Images.Count}");prs.Save("with-image.pptx",SaveFormat.Pptx);