AiImage Class
The Adobe Illustrator (AI) Image
Inheritance Hierarchy
SystemObject
  Aspose.PSDDisposableObject
    Aspose.PSDDataStreamSupporter
      Aspose.PSDImage
        Aspose.PSD.FileFormats.AiAiImage

Namespace: Aspose.PSD.FileFormats.Ai
Assembly: Aspose.PSD (in Aspose.PSD.dll) Version: 21.4
Syntax
public sealed class AiImage : Image

The AiImage type exposes the following members.

Constructors
  NameDescription
Public methodAiImage
Initializes a new instance of the AiImage class
Properties
  NameDescription
Public propertyAutoAdjustPalette
Gets or sets a value indicating whether automatic adjust palette.
(Inherited from Image.)
Public propertyBackgroundColor
Gets or sets a value for the background color.
(Inherited from Image.)
Public propertyBitsPerPixel
Gets the image bits per pixel count.
(Overrides ImageBitsPerPixel.)
Public propertyBounds
Gets the image bounds.
(Inherited from Image.)
Public propertyBufferSizeHint
Gets or sets the buffer size hint which is defined max allowed size for all internal buffers.
(Inherited from Image.)
Public propertyContainer
Gets the Image container.
(Inherited from Image.)
Public propertyDataSection
Gets the data section.
Public propertyDataStreamContainer
Gets the object's data stream.
(Inherited from DataStreamSupporter.)
Public propertyDisposed
Gets a value indicating whether this instance is disposed.
(Inherited from DisposableObject.)
Public propertyFileFormat
Gets a value of file format
(Overrides ImageFileFormat.)
Public propertyFinalizeSection
Gets the finalize section.
Public propertyHasBackgroundColor
Gets or sets a value indicating whether image has background color.
(Inherited from Image.)
Public propertyHeader
Gets the header.
Public propertyHeight
Gets the image height.
(Overrides ImageHeight.)
Public propertyInterruptMonitor
Gets or sets the interrupt monitor.
(Inherited from Image.)
Public propertyIsCached
Gets a value indicating whether object's data is cached currently and no data reading is required.
(Overrides DataStreamSupporterIsCached.)
Public propertyLayers
Gets the layer sections.
Public propertyPalette
Gets or sets the color palette. The color palette is not used when pixels are represented directly.
(Inherited from Image.)
Public propertySetupSection
Gets the setup section.
Public propertySize
Gets the image size.
(Inherited from Image.)
Public propertyVersion
Gets the version of Adobe Illustrator format
Public propertyWidth
Gets the image width.
(Overrides ImageWidth.)
Methods
  NameDescription
Public methodAddLayer
Adds the AI layer section.
Public methodCacheData
Caches the data and ensures no additional data loading will be performed from the underlying DataStreamContainer.
(Overrides DataStreamSupporterCacheData.)
Public methodCanSave
Determines whether image can be saved to the specified file format represented by the passed save options.
(Inherited from Image.)
Public methodDispose
Disposes the current instance.
(Inherited from DisposableObject.)
Public methodEquals (Inherited from Object.)
Public methodGetDefaultOptions
Gets the default options.
(Inherited from Image.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetOriginalOptions
Gets the options based on the original file settings. This can be helpful to keep bit-depth and other parameters of the original image unchanged. For example, if we load a black-white PNG image with 1 bit per pixel and then save it using the Save(String) method, the output PNG image with 8-bit per pixel will be produced. To avoid it and save PNG image with 1-bit per pixel, use this method to get corresponding saving options and pass them to the Save(String, ImageOptionsBase) method as the second parameter.
(Inherited from Image.)
Public methodGetType (Inherited from Object.)
Public methodCode exampleResize(Int32, Int32)
Resizes the image. The default LeftTopToLeftTop is used.
(Inherited from Image.)
Public methodResize(Int32, Int32, ImageResizeSettings)
Resizes the image.
(Overrides ImageResize(Int32, Int32, ImageResizeSettings).)
Public methodResize(Int32, Int32, ResizeType)
Resizes the image.
(Overrides ImageResize(Int32, Int32, ResizeType).)
Public methodResizeHeightProportionally(Int32)
Resizes the height proportionally.
(Inherited from Image.)
Public methodResizeHeightProportionally(Int32, ImageResizeSettings)
Resizes the height proportionally.
(Inherited from Image.)
Public methodResizeHeightProportionally(Int32, ResizeType)
Resizes the height proportionally.
(Inherited from Image.)
Public methodResizeWidthProportionally(Int32)
Resizes the width proportionally.
(Inherited from Image.)
Public methodResizeWidthProportionally(Int32, ImageResizeSettings)
Resizes the width proportionally.
(Inherited from Image.)
Public methodResizeWidthProportionally(Int32, ResizeType)
Resizes the width proportionally.
(Inherited from Image.)
Public methodRotateFlip
Rotates, flips, or rotates and flips the image.
(Overrides ImageRotateFlip(RotateFlipType).)
Public methodSave
Saves the image data to the underlying stream.
(Inherited from Image.)
Public methodSave(Stream)
Saves the object's data to the specified stream.
(Inherited from DataStreamSupporter.)
Public methodSave(String)
Saves the object's data to the specified file location.
(Inherited from DataStreamSupporter.)
Public methodSave(String, Boolean)
Saves the object's data to the specified file location.
(Inherited from DataStreamSupporter.)
Public methodCode exampleSave(Stream, ImageOptionsBase)
Saves the image's data to the specified stream in the specified file format according to save options.
(Inherited from Image.)
Public methodCode exampleSave(String, ImageOptionsBase)
Saves the object's data to the specified file location in the specified file format according to save options.
(Inherited from Image.)
Public methodSave(Stream, ImageOptionsBase, Rectangle)
Saves the image's data to the specified stream in the specified file format according to save options.
(Inherited from Image.)
Public methodSave(String, ImageOptionsBase, Rectangle)
Saves the object's data to the specified file location in the specified file format according to save options.
(Inherited from Image.)
Public methodSetPalette
Sets the image palette.
(Overrides ImageSetPalette(IColorPalette, Boolean).)
Public methodToString (Inherited from Object.)
Examples
The following example demonstrates how you can export Adobe Illustrator files to PDF format in Aspose.PSD
[C#]

string sourceFilePath = "rect2_color.ai";
string outputFilePath = "rect2_color.ai_output.pdf";
using (AiImage image = (AiImage)Image.Load(sourceFilePath))
{
    image.Save(outputFilePath, new PdfOptions());
}
Examples
The following example demonstrates how you can export AI file to PSD and PNG format in Aspose.PSD
[C#]

string sourceFileName = "form_8.ai";
string outputFileName = "form_8_export";
using (AiImage image = (AiImage)Image.Load(sourceFileName))
{
    image.Save(outputFileName + ".psd", new PsdOptions());
    image.Save(outputFileName + ".png", new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha });
}
Examples
The following example demonstrates the support of the exporting Ai format to PSD, PNG, JPG, GIF and TIF formats.
[C#]

string[] sourcesFiles = new string[]
{
    @"34992OStroke",
    @"rect2_color",
};
for (int i = 0; i < sourcesFiles.Length; i++)
{
    string name = sourcesFiles[i];
    string sourceFileName = name + ".ai";

    using (AiImage image = (AiImage)Image.Load(sourceFileName))
    {
        string outFileName = name + ".psd";
        ImageOptionsBase options = new PsdOptions();
        image.Save(outFileName, options);

        outFileName = name + ".png";
        options = new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha };
        image.Save(outFileName, options);

        outFileName = name + ".jpg";
        options = new JpegOptions() { Quality = 85 };
        image.Save(outFileName, options);

        outFileName = name + ".gif";
        options = new GifOptions() { DoPaletteCorrection = false };
        image.Save(outFileName, options);

        outFileName = name + ".tif";
        options = new TiffOptions(TiffExpectedFormat.TiffDeflateRgba);
        image.Save(outFileName, options);
    }
}
See Also