Class OdgImage
Namespace: Aspose.Imaging.FileFormats.OpenDocument
Assembly: Aspose.Imaging.dll (25.2.0)
The open document
[JsonObject(MemberSerialization.OptIn)]
public class OdgImage : OdImage, IDisposable, IObjectWithBounds, IObjectWithSizeF, IMultipageImage
Inheritance
object ← DisposableObject ← DataStreamSupporter ← Image ← VectorImage ← VectorMultipageImage ← OdImage ← OdgImage
Implements
IDisposable, IObjectWithBounds, IObjectWithSizeF, IMultipageImage
Inherited Members
OdImage.ReleaseManagedResources(), OdImage.DefaultPage, OdImage.IsCached, OdImage.BitsPerPixel, OdImage.PageCount, OdImage.Metadata, OdImage.Records, VectorMultipageImage.CacheData(), VectorMultipageImage.Crop(Rectangle), VectorMultipageImage.Resize(int, int, ResizeType), VectorMultipageImage.Rotate(float), VectorMultipageImage.Resize(int, int, ImageResizeSettings), VectorMultipageImage.RotateFlip(RotateFlipType), VectorMultipageImage.RemoveBackground(RemoveBackgroundSettings), VectorMultipageImage.RemoveBackground(), VectorMultipageImage.SetPalette(IColorPalette, bool), VectorMultipageImage.GetEmbeddedImages(), VectorMultipageImage.SaveData(Stream), VectorMultipageImage.GetSerializedStream(ImageOptionsBase, Rectangle, out int), VectorMultipageImage.ReleaseManagedResources(), VectorMultipageImage.PageCount, VectorMultipageImage.Pages, VectorMultipageImage.DefaultPage, VectorMultipageImage.IsCached, VectorMultipageImage.BitsPerPixel, VectorMultipageImage.Width, VectorMultipageImage.Height, VectorMultipageImage.PageExportingAction, VectorImage.GetEmbeddedImages(), VectorImage.RemoveBackground(), VectorImage.RemoveBackground(RemoveBackgroundSettings), VectorImage.Resize(int, int, ResizeType), VectorImage.Resize(int, int, ImageResizeSettings), VectorImage.RotateFlip(RotateFlipType), VectorImage.Crop(Rectangle), VectorImage.Rotate(float), VectorImage.Modify(RectangleF, float, float, float), VectorImage.SizeF, VectorImage.WidthF, VectorImage.HeightF, VectorImage.Width, VectorImage.Height, Image.CanLoad(string), Image.CanLoad(string, LoadOptions), Image.CanLoad(Stream), Image.CanLoad(Stream, LoadOptions), Image.Create(ImageOptionsBase, int, int), Image.Create(Image[]), Image.Create(MultipageCreateOptions), Image.Create(string[], bool), Image.Create(string[]), Image.Create(Image[], bool), Image.GetFileFormat(string), Image.GetFileFormat(Stream), Image.GetFittingRectangle(Rectangle, int, int), Image.GetFittingRectangle(Rectangle, int[], int, int), Image.Load(string, LoadOptions), Image.Load(string), Image.Load(Stream, LoadOptions), Image.Load(Stream), Image.GetProportionalWidth(int, int, int), Image.GetProportionalHeight(int, int, int), Image.RemoveMetadata(), Image.CanSave(ImageOptionsBase), Image.Resize(int, int), Image.Resize(int, int, ResizeType), Image.Resize(int, int, ImageResizeSettings), Image.GetDefaultOptions(object[]), Image.GetOriginalOptions(), Image.ResizeWidthProportionally(int), Image.ResizeHeightProportionally(int), Image.ResizeWidthProportionally(int, ResizeType), Image.ResizeHeightProportionally(int, ResizeType), Image.ResizeWidthProportionally(int, ImageResizeSettings), Image.ResizeHeightProportionally(int, ImageResizeSettings), Image.RotateFlip(RotateFlipType), Image.Rotate(float), Image.Crop(Rectangle), Image.Crop(int, int, int, int), Image.Save(), Image.Save(string), Image.Save(string, ImageOptionsBase), Image.Save(string, ImageOptionsBase, Rectangle), Image.Save(Stream, ImageOptionsBase), Image.Save(Stream, ImageOptionsBase, Rectangle), Image.GetSerializedStream(ImageOptionsBase, Rectangle, out int), Image.SetPalette(IColorPalette, bool), Image.UpdateContainer(Image), Image.GetCanNotSaveMessage(ImageOptionsBase), Image.GetFitRectangle(Rectangle), Image.GetImage2Export(ImageOptionsBase, Rectangle, IImageExporter), Image.GetFitRectangle(Rectangle, int[]), Image.OnPaletteChanged(IColorPalette, IColorPalette), Image.OnPaletteChanging(IColorPalette, IColorPalette), Image.ReleaseManagedResources(), Image.BitsPerPixel, Image.Bounds, Image.Container, Image.Height, Image.Palette, Image.UsePalette, Image.Size, Image.Width, Image.InterruptMonitor, Image.BufferSizeHint, Image.AutoAdjustPalette, Image.HasBackgroundColor, Image.FileFormat, Image.BackgroundColor, DataStreamSupporter.timeout, DataStreamSupporter.CacheData(), DataStreamSupporter.Save(), DataStreamSupporter.Save(Stream), DataStreamSupporter.Save(string), DataStreamSupporter.Save(string, bool), DataStreamSupporter.SaveData(Stream), DataStreamSupporter.ReleaseManagedResources(), DataStreamSupporter.OnDataStreamContainerChanging(StreamContainer), DataStreamSupporter.DataStreamContainer, DataStreamSupporter.IsCached, DisposableObject.Dispose(), DisposableObject.ReleaseManagedResources(), DisposableObject.ReleaseUnmanagedResources(), DisposableObject.VerifyNotDisposed(), DisposableObject.Disposed, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Examples
This example loads a multi-page ODG image.```csharp [C#]
string dir = "c:\\temp\\";
// Using Aspose.Imaging.Image.Load is a unified way to load image.
using (Aspose.Imaging.FileFormats.OpenDocument.OdImage image = (Aspose.Imaging.FileFormats.OpenDocument.OdImage)Aspose.Imaging.Image.Load(dir + "sample.odg"))
{
// Cast to OdgImage
Aspose.Imaging.FileFormats.OpenDocument.OdgImage odgImage = (Aspose.Imaging.FileFormats.OpenDocument.OdgImage)image;
// Get all pages
Aspose.Imaging.Image[] pages = odgImage.Pages;
// Do some image processing
}
The following example shows how to export a FODG (Flat XML ODF Template) image to PDF format.```csharp
[C#]
string dir = "c:\\aspose.imaging\\issues\\net\\3635";
string inputFileName = System.IO.Path.Combine(dir, "VariousObjectsMultiPage.fodg");
string outputFileName = inputFileName + ".pdf";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(inputFileName))
{
Aspose.Imaging.ImageOptions.OdgRasterizationOptions rasterizationOptions = new Aspose.Imaging.ImageOptions.OdgRasterizationOptions();
rasterizationOptions.BackgroundColor = Aspose.Imaging.Color.White;
rasterizationOptions.PageSize = image.Size;
Aspose.Imaging.ImageOptions.PdfOptions saveOptions = new Aspose.Imaging.ImageOptions.PdfOptions();
saveOptions.VectorRasterizationOptions = rasterizationOptions;
image.Save(outputFileName, saveOptions);
}
Constructors
OdgImage(StreamContainer, LoadOptions)
Start a new creation of the Aspose.Imaging.FileFormats.OpenDocument.OdgImage class object with the initiation of a fresh instance. Harness the potential of a stream container coupled with load options parameters, maintain a versatile constructor to seamlessly load images. This constructor empowers efficient image handling, offering customizable loading configurations for enhanced adaptability and performance across diverse scenarios.
public OdgImage(StreamContainer streamContainer, LoadOptions options)
Parameters
streamContainer
StreamContainer
The stream.
options
LoadOptions
The load options
OdgImage(StreamContainer)
Crafted for seamless integration into software solutions, the Aspose.Imaging.FileFormats.OpenDocument.OdgImage constructor initializes a new instance by leveraging a stream container. This method ensures efficient handling of ODG image data within software environments, optimizing resource utilization and facilitating streamlined image processing workflows.
public OdgImage(StreamContainer streamContainer)
Parameters
streamContainer
StreamContainer
The stream container.
Properties
FileFormat
Gets a value of file format
public override FileFormat FileFormat { get; }
Property Value
Pages
Retrieving the collection of pages, this property empowers to access the entirety of pages associated with an image. By accessing this property, developers can iterate through individual pages, retrieve specific pages based on their index, or perform batch operations on the entire collection.
public override Image[] Pages { get; }
Property Value
Image[]
Methods
GetDefaultOptions(object[])
This property provides access to the default options associated with an image. By retrieving these options, developers can quickly ascertain the default settings applied to the image, facilitating the creation of new instances or the modification of existing ones based on these presets.
public override ImageOptionsBase GetDefaultOptions(object[] args)
Parameters
args
object[]
The arguments.
Returns
Default options