Clone
Contents
[
Hide
]ImageSaveOptions.Clone method
Creates a deep clone of this object.
public ImageSaveOptions Clone()
Examples
Shows how to select a bit-per-pixel rate with which to render a document to an image.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.ParagraphFormat.Style = doc.Styles["Heading 1"];
builder.Writeln("Hello world!");
builder.InsertImage(ImageDir + "Logo.jpg");
// When we save the document as an image, we can pass a SaveOptions object to
// select a pixel format for the image that the saving operation will generate.
// Various bit per pixel rates will affect the quality and file size of the generated image.
ImageSaveOptions imageSaveOptions = new ImageSaveOptions(SaveFormat.Png);
imageSaveOptions.PixelFormat = imagePixelFormat;
// We can clone ImageSaveOptions instances.
Assert.AreNotEqual(imageSaveOptions, imageSaveOptions.Clone());
doc.Save(ArtifactsDir + "ImageSaveOptions.PixelFormat.png", imageSaveOptions);
See Also
- class ImageSaveOptions
- namespace Aspose.Words.Saving
- assembly Aspose.Words