ImageCollection

ImageCollection

Overview

ImageCollection is a class in Aspose.PDF FOSS for .NET. Inherits from: IReadOnlyList<ImageXObject>.

Collection of image XObjects on a page.

This class provides 5 methods for working with ImageCollection objects in .NET programs. Available methods include: GetByName, GetEnumerator, Replace. All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package. Properties: Count.

Properties

NameTypeAccessDescription
CountintReadGets the count.

Methods

SignatureDescription
GetByName(name: string)Get an image by its resource name (e.g., “Im0”, “JI1a”).
Replace(index: int, stream: Stream)Replace the image data at the given 1-based index with the provided stream.
Replace(name: string, stream: Stream)Replace the image with the given resource name.
Replace(index: int, stream: Stream, quality: int, optimize: bool)Replace the image at the given 1-based index with the provided stream, re-encoding to JPEG at quality (0–100).
GetEnumerator()Calls GetEnumerator on this ImageCollection instance.

See Also