ImageDataImageSize Property

Gets the information about image size and resolution.

Namespace:  Aspose.Words.Drawing
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public ImageSize ImageSize { get; }

Property Value

Type: ImageSize
Remarks

If the image is linked only and not stored in the document, returns zero size.

Examples
Shows how to resize an image shape.
DocumentBuilder builder = new DocumentBuilder();

// By default, the image is inserted at 100% scale
Shape shape = builder.InsertImage(ImageDir + "Logo.jpg");

// It is easy to change the shape size. In this case, make it 50% relative to the current shape size
shape.Width = shape.Width * 0.5;
shape.Height = shape.Height * 0.5;

// However, we can also go back to the original image size and scale from there, say 110%
ImageSize imageSize = shape.ImageData.ImageSize;
shape.Width = imageSize.WidthPoints * 1.1;
shape.Height = imageSize.HeightPoints * 1.1;

builder.Document.Save(ArtifactsDir + "Image.ScaleImage.doc");
See Also