Aspose.Imaging.Examples.CSharp.ModifyingAndConvertingImages.ResizeImageWithResizeTypeEnumeration.Run C# (CSharp) Метод

Run() публичный статический Метод

public static Run ( ) : void
Результат void
        public static void Run()
        {
            // ExStart:ResizeImageWithResizeTypeEnumeration
            // 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 only height, width and ResizeType
                int newWidth = image.Width / 2;
                image.ResizeWidthProportionally(newWidth, ResizeType.LanczosResample);
                int newHeight = image.Height / 2;
                image.ResizeHeightProportionally(newHeight, ResizeType.NearestNeighbourResample);
                image.Save(dataDir + "ResizeImageWithResizeTypeEnumeration_out.png");
            }
            // ExEnd:ResizeImageWithResizeTypeEnumeration
        }
    }
ResizeImageWithResizeTypeEnumeration