Table of Contents

Method Save

Namespace
Aspose.CAD
Assembly
Aspose.CAD.dll

Save()

Saves the image data to the underlying stream.

public override sealed void Save()

Examples

Saves all changes made to drawing. Note: Only DXF is currently supported

using (var image = Aspose.CAD.Image.Load("fileName.dwg"))
{
    image.Save();
}

Save(string, ImageOptionsBase)

Saves the object's data to the specified file location in the specified file format according to save options.

public virtual void Save(string filePath, ImageOptionsBase options)

Parameters

filePath string

The file path.

options ImageOptionsBase

The options.

Examples

Exports drawing to BMP with specified size

using (var image = Aspose.CAD.Image.Load("fileName.dwg"))
{
    image.Save("targetFile.bmp", new BmpOptions()
    {
        VectorRasterizationOptions = new CadRasterizationOptions()
        {
            PageWidth = 640,
            PageHeight = 480
        }
    });
}

Save(Stream, ImageOptionsBase)

Saves the image's data to the specified stream in the specified file format according to save options.

public void Save(Stream stream, ImageOptionsBase optionsBase)

Parameters

stream Stream

The stream to save the image's data to.

optionsBase ImageOptionsBase

The save options.

Examples

Exports drawing to JPEG format and rotate it by 90 degrees then writes to memory stream

using (var ms = new MemoryStream())
{
    using (var image = Aspose.CAD.Image.Load("fileName.dwg"))
    {
        image.Save(ms, new JpegOptions()
        {
            Rotation = RotateFlipType.Rotate90FlipNone
        });
    }
}

Exceptions

ArgumentNullException

optionsBase

ArgumentException

Cannot save to the specified format as it is not supported at the moment.;optionsBase

ImageSaveException

Image export failed.