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

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

public static Run ( ) : void
Результат void
        public static void Run()
        {
            // ExStart:ConvertSpecificPortionOfDjVuPage
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_DjVu();

            // Load a DjVu image
            using (DjvuImage image = (DjvuImage)Image.Load(dataDir + "Sample.djvu"))
            {
                // Create an instance of PngOptions and Set ColorType to Grayscale
                PngOptions exportOptions = new PngOptions();
                exportOptions.ColorType = PngColorType.Grayscale;
                
                // Create an instance of Rectangle and specify the portion on DjVu page
                Rectangle exportArea = new Rectangle(0, 0, 500, 500);

                // Specify the DjVu page index and Initialize an instance of DjvuMultiPageOptions while passing index of DjVu page index and instance of Rectangle covering the area to be exported               
                int exportPageIndex = 2;
                exportOptions.MultiPageOptions = new DjvuMultiPageOptions(exportPageIndex, exportArea);
                image.Save(dataDir + "ConvertSpecificPortionOfDjVuPage_out.djvu", exportOptions);
            }
            // ExEnd:ConvertSpecificPortionOfDjVuPage
        }
    }
ConvertSpecificPortionOfDjVuPage