public static void Run()
{
// ExStart:SimpleResizeImageProportionally
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_ModifyingAndConvertingImages();
// Load an image from disk
using (Image image = Image.Load(dataDir + "aspose-logo.jpg"))
{
if (!image.IsCached)
{
image.CacheData();
}
// Specifying width and height
int newWidth = image.Width / 2;
image.ResizeWidthProportionally(newWidth);
int newHeight = image.Height / 2;
image.ResizeHeightProportionally(newHeight);
image.Save(dataDir + "SimpleResizeImageProportionally_out.png");
}
// ExEnd:SimpleResizeImageProportionally
}
}