ImageDataImageSize Property |
Namespace: Aspose.Words.Drawing
If the image is linked only and not stored in the document, returns zero size.
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");