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 });

显示如何使用 ImageSaveOptions 在 Bmp 格式中保存文档作为图像。

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);

显示如何使用 CCITT Group 3 传真压缩保存文档作为图像的 Tiff 格式。

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

ImageSaveOptions(保存格式)

启动 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 });

显示如何使用 CCITT Group 3 传真压缩保存文档作为图像的 Tiff 格式。

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.Imagin.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
   });

显示如何使用 CCITT Group 3 传真压缩保存文档作为图像的 Tiff 格式。

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
   });
 中文