ImageSaveOptionsHorizontalResolution Property

Gets or sets the horizontal resolution for the generated images, in dots per inch.

Namespace:  Aspose.Words.Saving
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public float HorizontalResolution { get; set; }

Property Value

Type: Single
Remarks

This property has effect only when saving to raster image formats and affects the output size in pixels.

The default value is 96.

Examples
Document doc = new Document(MyDir + "Rendering.docx");

// When saving the document as an image, we can use an ImageSaveOptions object to edit various aspects of it
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.Png)
{
    ImageBrightness = 0.3f,     // 0 - 1 scale, default at 0.5
    ImageContrast = 0.7f,       // 0 - 1 scale, default at 0.5
    HorizontalResolution = 72f, // Default at 96.0 meaning 96dpi, image dimensions will be affected if we change resolution
    VerticalResolution = 72f,   // Default at 96.0 meaning 96dpi
    Scale = 96f / 72f           // Default at 1.0 for normal scale, can be used to negate resolution impact in image size
};

doc.Save(ArtifactsDir + "ImageSaveOptions.EditImage.png", options);
See Also