Class ImageSaveOptions

Class ImageSaveOptions

نام ها : Aspose.Note.Saving جمع آوری: Aspose.Note.dll (25.4.0)

اجازه می دهد تا گزینه های اضافی را در هنگام ارائه صفحات اسناد به تصاویر مشخص کنید.

public class ImageSaveOptions : SaveOptions
{
}
Here's an example of how a multi-line class declaration would look like:
public class MyClass
{
    public int Property1 { get; set; }
    public void Method1()
    {
    }
    public void Method2(int someValue)
    {
    }
}

Inheritance

object SaveOptions ImageSaveOptions

اعضای ارثی

SaveOptions.SaveFormat , SaveOptions.FontsSubsystem , SaveOptions.PageIndex , SaveOptions.PageCount , object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Examples

نشان می دهد که چگونه یک سند را به عنوان تصویر در فرمت Jpeg با استفاده از SaveFormat ذخیره کنید.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(dataDir + "Aspose.one");
   dataDir += "SaveToJpegImageUsingSaveFormat_out.jpg";
   oneFile.Save(dataDir, SaveFormat.Jpeg);

نشان می دهد که چگونه برای تنظیم کیفیت تصویر هنگام ذخیره اسناد به عنوان تصویر در فرمت JPEG.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document doc = new Document(dataDir + "Aspose.one");
   dataDir += "SetOutputImageResolution_out.jpg";
   doc.Save(dataDir, new ImageSaveOptions { Quality = 100 });

نشان می دهد که چگونه یک سند را به عنوان تصویر در فرمت Bmp با استفاده از ImageSaveOptions ذخیره کنید.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(dataDir + "Aspose.one");
   dataDir += "SaveToBmpImageUsingImageSaveOptions_out.bmp";
   oneFile.Save(dataDir, new ImageSaveOptions(SaveFormat.Bmp));

نشان می دهد که چگونه برای تنظیم رزولوشن تصویر هنگام ذخیره اسناد به عنوان تصویر.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document doc = new Document(dataDir + "Aspose.one");
   dataDir += "SetOutputImageResolution_out.jpg";
   doc.Save(dataDir, new ImageSaveOptions(SaveFormat.Jpeg) { Resolution = 220 });

نشان می دهد که چگونه یک سند را به عنوان تصویر خاکستری ذخیره کنید.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(dataDir + "Aspose.one");
   dataDir += "SaveAsGrayscaleImage_out.png";
   oneFile.Save(dataDir, new ImageSaveOptions(SaveFormat.Png)
   {
      ColorMode = ColorMode.GrayScale
   });

نشان می دهد که چگونه یک سند را به عنوان تصویر در فرمت Tiff با استفاده از فشرده سازی PackBits ذخیره کنید.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(Path.Combine(dataDir, "Aspose.one"));
   var dst = Path.Combine(dataDir, "SaveToTiffUsingPackBitsCompression.tiff");
   oneFile.Save(dst, new ImageSaveOptions(SaveFormat.Tiff)
   {
      TiffCompression = TiffCompression.PackBits
   });

نشان می دهد که چگونه برای ذخیره نوت بوک به عنوان تصویر با گزینه های مشخص شده.

string dataDir = RunExamples.GetDataDir_NoteBook();
   var notebook = new Notebook(dataDir + "Notizbuch Öffnen.onetoc2");
   var notebookSaveOptions = new NotebookImageSaveOptions(SaveFormat.Png);
   var documentSaveOptions = notebookSaveOptions.DocumentSaveOptions;
   documentSaveOptions.Resolution = 400;
   dataDir += "ConvertToImageWithOptions_out.png";
   notebook.Save(dataDir, notebookSaveOptions);

نشان می دهد که چگونه یک سند را به عنوان تصویر در فرمت Tiff با استفاده از فشرده سازی Jpeg ذخیره کنید.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(Path.Combine(dataDir, "Aspose.one"));
   var dst = Path.Combine(dataDir, "SaveToTiffUsingJpegCompression.tiff");
   oneFile.Save(dst, new ImageSaveOptions(SaveFormat.Tiff)
   {
      TiffCompression = TiffCompression.Jpeg,
      Quality = 93
   });

نشان می دهد که چگونه برای ذخیره نوت بوک به عنوان تصویر.

string dataDir = RunExamples.GetDataDir_NoteBook();
   var notebook = new Notebook(dataDir + "Notizbuch öffnen.onetoc2");
   var notebookSaveOptions = new NotebookImageSaveOptions { SaveFormat = SaveFormat.Png };
   var documentSaveOptions = notebookSaveOptions.DocumentSaveOptions;
   documentSaveOptions.Resolution = 400;
   notebookSaveOptions.Flatten = true;
   dataDir += "ConvertToImageAsFlattenedNotebook_out.png";
   notebook.Save(dataDir, notebookSaveOptions);

نشان می دهد که چگونه یک سند را به عنوان تصویر در فرمت Tiff با استفاده از فکس فشرده سازی CCITT Group 3 ذخیره کنید.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(Path.Combine(dataDir, "Aspose.one"));
   var dst = Path.Combine(dataDir, "SaveToTiffUsingCcitt3Compression.tiff");
   oneFile.Save(dst, new ImageSaveOptions(SaveFormat.Tiff)
                  {
                      ColorMode = ColorMode.BlackAndWhite,
                      TiffCompression = TiffCompression.Ccitt3
                  });

نشان می دهد که چگونه یک سند را در فرمت png ذخیره کنید.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(dataDir + "Aspose.one");
   ImageSaveOptions opts = new ImageSaveOptions(SaveFormat.Png)
   {
      PageIndex = 1
   };
   dataDir = dataDir + "ConvertSpecificPageToImage_out.png";
   oneFile.Save(dataDir, opts);

نشان می دهد که چگونه یک سند را به عنوان یک تصویر باینری با استفاده از روش Otsu ذخیره کنید.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(dataDir + "Aspose.one");
   dataDir += @"\SaveToBinaryImageUsingOtsuMethod_out.png";
   oneFile.Save(dataDir, new ImageSaveOptions(SaveFormat.Png)
   {
      ColorMode = ColorMode.BlackAndWhite,
      BinarizationOptions = new ImageBinarizationOptions()
      {
         BinarizationMethod = BinarizationMethod.Otsu,
      }
   });

نشان می دهد که چگونه یک سند را به عنوان یک تصویر باینری با استفاده از حد ثابت ذخیره کنید.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(dataDir + "Aspose.one");
   dataDir += "SaveToBinaryImageUsingFixedThreshold_out.png";
   oneFile.Save(dataDir, new ImageSaveOptions(SaveFormat.Png)
   {
      ColorMode = ColorMode.BlackAndWhite,
      BinarizationOptions = new ImageBinarizationOptions()
      {
         BinarizationMethod = BinarizationMethod.FixedThreshold,
         BinarizationThreshold = 123
      }
   });

Constructors

گزینه های ذخیره سازی (SaveFormat)

یک مثال جدید از کلاس Aspose.Note.Saving.ImageSaveOptions آغاز می شود.

public ImageSaveOptions(SaveFormat format)
   {
      Format = format;
   }

Parameters

format SaveFormat

فرمت که در آن اسناد ذخیره می شود.

Properties

BinarizationOptions

به دست آوردن یا تنظیم گزینه های برای تصویر دوگانه.

public ImageBinarizationOptions BinarizationOptions
   {
      get;
      set;
   }

ارزش املاک

ImageBinarizationOptions

Examples

نشان می دهد که چگونه یک سند را به عنوان یک تصویر باینری با استفاده از روش Otsu ذخیره کنید.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(dataDir + "Aspose.one");
   dataDir += "SaveToBinaryImageUsingOtsuMethod_out.png";
   oneFile.Save(dataDir, new ImageSaveOptions(SaveFormat.Png)
   {
      ColorMode = ColorMode.BlackAndWhite,
      BinarizationOptions = new ImageBinarizationOptions()
      {
         BinarizationMethod = BinarizationMethod.Otsu,
      }
   });

نشان می دهد که چگونه یک سند را به عنوان یک تصویر باینری با استفاده از حد ثابت ذخیره کنید.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(dataDir + "Aspose.one");
   dataDir += "SaveToBinaryImageUsingFixedThreshold_out.png";
   oneFile.Save(dataDir, new ImageSaveOptions(SaveFormat.Png)
   {
      ColorMode = ColorMode.BlackAndWhite,
      BinarizationOptions = new ImageBinarizationOptions()
      {
         BinarizationMethod = BinarizationMethod.FixedThreshold,
         BinarizationThreshold = 123
      }
   });

ColorMode

دریافت یا تنظیم Aspose.Note.Saving.ImageSaveOptions.ColorMode برای تصویر خروجی.

public ColorMode ColorMode
   {
      get;
      set;
   }

ارزش املاک

ColorMode

Examples

نشان می دهد که چگونه یک سند را به عنوان تصویر خاکستری ذخیره کنید.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(dataDir + "Aspose.one");
   dataDir += "SaveAsGrayscaleImage_out.png";
   oneFile.Save(dataDir, new ImageSaveOptions { SaveFormat = SaveFormat.Png, ColorMode = ColorMode.GrayScale });

نشان می دهد که چگونه یک سند را به عنوان تصویر در فرمت Tiff با استفاده از فکس فشرده سازی CCITT Group 3 ذخیره کنید.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(Path.Combine(dataDir, "Aspose.one"));
   var dst = Path.Combine(dataDir, "SaveToTiffUsingCcitt3Compression.tiff");
   oneFile.Save(dst, new ImageSaveOptions(SaveFormat.Tiff)
   {
      ColorMode = ColorMode.BlackAndWhite,
      TiffCompression = TiffCompression.Ccitt3
   });

نشان می دهد که چگونه یک سند را به عنوان یک تصویر باینری با استفاده از روش Otsu ذخیره کنید.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(dataDir + "Aspose.one");
   dataDir += "SaveToBinaryImageUsingOtsuMethod_out.png";
   oneFile.Save(dataDir, new ImageSaveOptions(SaveFormat.Png)
   {
      ColorMode = ColorMode.BlackAndWhite,
      BinarizationOptions = new ImageBinarizationOptions()
      {
         BinarizationMethod = BinarizationMethod.Otsu,
      }
   });

نشان می دهد که چگونه یک سند را به عنوان یک تصویر باینری با استفاده از حد ثابت ذخیره کنید.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(dataDir + "Aspose.one");
   dataDir += "SaveToBinaryImageUsingFixedThreshold_out.png";
   oneFile.Save(dataDir, new ImageSaveOptions(SaveFormat.Png)
   {
      ColorMode = ColorMode.BlackAndWhite,
      BinarizationOptions = new ImageBinarizationOptions()
      {
         BinarizationMethod = BinarizationMethod.FixedThreshold,
         BinarizationThreshold = 123
      }
   });

Quality

به دست آوردن یا تعیین ارزش تعیین کیفیت تصویر ذخیره شده.این مقدار به کدک به عنوان پارامتر System.Drawing.Imaging.Encoder.Quality منتقل می شود.

public int Quality
   {
      get;
      set;
   }

ارزش املاک

int

Examples

نشان می دهد که چگونه برای تنظیم کیفیت تصویر هنگام ذخیره اسناد به عنوان تصویر در فرمت JPEG.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document doc = new Document(dataDir + "Aspose.one");
   dataDir += "SetOutputImageResolution_out.jpg";
   doc.Save(dataDir, new ImageSaveOptions { Quality = 100 });
   new ImageSaveOptions(SaveFormat.Jpeg) { Quality = 100 } // Move this object for better readability
   doc.Save(dataDir, it); // Use 'it' to make the Save method call cleaner

نشان می دهد که چگونه یک سند را به عنوان تصویر در فرمت Tiff با استفاده از فشرده سازی Jpeg ذخیره کنید.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(Path.Combine(dataDir, "Aspose.one"));
   var dst = Path.Combine(dataDir, "SaveToTiffUsingJpegCompression.tiff");
   oneFile.Save(dst, new ImageSaveOptions(SaveFormat.Tiff)
   {
      TiffCompression = TiffCompression.Jpeg,
      Quality = 93
   });

Remarks

محدوده ارزش های مفید برای رده کیفیت از 0 تا 100 است.کمتر تعداد مشخص شده، بیشتر فشرده سازی و بنابراین کیفیت تصویر پایین تر است.صفر به شما کمترین کیفیت تصویر و 100 بالاترین کیفیت را می دهد.ارزش پیش فرض 90 است.

Resolution

دریافت یا تنظیم رزولوشن برای تصاویر تولید شده، در نقطه در اینچ.

public float Resolution
   {
      get;
      set;
   }

ارزش املاک

float

Examples

نشان می دهد که چگونه برای تنظیم رزولوشن تصویر هنگام ذخیره اسناد به عنوان تصویر.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document doc = new Document(dataDir + "Aspose.one");
   dataDir += "SetOutputImageResolution_out.jpg";
   doc.Save(dataDir, new ImageSaveOptions(SaveFormat.Jpeg) { Resolution = 220 });

نشان می دهد که چگونه برای ذخیره نوت بوک به عنوان تصویر با گزینه های مشخص شده.

string dataDir = RunExamples.GetDataDir_NoteBook();
   var notebook = new Notebook(dataDir + "Notizbuch �ffnen.onetoc2");
   var notebookSaveOptions = new NotebookImageSaveOptions(SaveFormat.Png);
   var documentSaveOptions = notebookSaveOptions.DocumentSaveOptions;
   documentSaveOptions.Resolution = 400;
   dataDir += "ConvertToImageWithOptions_out.png";
   notebook.Save(dataDir, notebookSaveOptions);

نشان می دهد که چگونه برای ذخیره نوت بوک به عنوان تصویر.

string dataDir = RunExamples.GetDataDir_NoteBook();
   var notebook = new Notebook(dataDir + "Notizbuch öffnen.onetoc2");
   var notebookSaveOptions = new NotebookImageSaveOptions { SaveFormat = SaveFormat.Png };
   var documentSaveOptions = notebookSaveOptions.DocumentSaveOptions;
   documentSaveOptions.Resolution = 400;
   notebookSaveOptions.Flatten = true;
   dataDir += "ConvertToImageAsFlattenedNotebook_out.png";
   notebook.Save(dataDir, notebookSaveOptions);

Remarks

ارزش پیش فرض 96 است.

TiffCompression

دریافت یا تنظیم نوع فشرده سازی برای استفاده در هنگام ذخیره تصاویر تولید شده به فرمت TIFF.

public TiffCompression TiffCompression
   {
      get;
      set;
   }

ارزش املاک

TiffCompression

Examples

نشان می دهد که چگونه یک سند را به عنوان تصویر در فرمت Tiff با استفاده از فشرده سازی PackBits ذخیره کنید.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(Path.Combine(dataDir, "Aspose.one"));
   var dst = Path.Combine(dataDir, "SaveToTiffUsingPackBitsCompression.tiff");
   oneFile.Save(dst, new ImageSaveOptions(SaveFormat.Tiff)
   {
      TiffCompression = TiffCompression.PackBits
   });

نشان می دهد که چگونه یک سند را به عنوان تصویر در فرمت Tiff با استفاده از فشرده سازی Jpeg ذخیره کنید.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(Path.Combine(dataDir, "Aspose.one"));
   var dst = Path.Combine(dataDir, "SaveToTiffUsingJpegCompression.tiff");
   oneFile.Save(dst, new ImageSaveOptions(SaveFormat.Tiff)
   {
      TiffCompression = TiffCompression.Jpeg,
      Quality = 93
   });

نشان می دهد که چگونه یک سند را به عنوان تصویر در فرمت Tiff با استفاده از فکس فشرده سازی CCITT Group 3 ذخیره کنید.

string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
   Document oneFile = new Document(Path.Combine(dataDir, "Aspose.one"));
   var dst = Path.Combine(dataDir, "SaveToTiffUsingCcitt3Compression.tiff");
   oneFile.Save(dst, new ImageSaveOptions(SaveFormat.Tiff)
   {
      ColorMode = ColorMode.BlackAndWhite,
      TiffCompression = TiffCompression.Ccitt3
   });
 فارسی