public void ScaleImage()
{
//ExStart
//ExFor:ImageData.ImageSize
//ExFor:ImageSize
//ExFor:ImageSize.WidthPoints
//ExFor:ImageSize.HeightPoints
//ExFor:ShapeBase.Width
//ExFor:ShapeBase.Height
//ExSummary:Shows how to resize an image shape.
DocumentBuilder builder = new DocumentBuilder();
// By default, the image is inserted at 100% scale.
Shape shape = builder.InsertImage(MyDir + "Aspose.Words.gif");
// 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(MyDir + @"\Artifacts\Image.ScaleImage.doc");
//ExEnd
}
}