Enum ColorMode
Enum ColorMode
Tên không gian: Aspose.Note.Saving Tổng hợp: Aspose.Note.dll (25.4.0)
Màu sắc của hình ảnh.
public enum ColorMode
Fields
BlackAndWhite = 2
Hình ảnh nhị phân: chỉ có màu đen và trắng được sử dụng
GrayScale = 1
Hình ảnh Gray Scale
Normal = 0
Hình ảnh đầy màu
Examples
Hiển thị cách lưu một tài liệu như một hình ảnh màu xám.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
// Load the document into Aspose.Note.
Document oneFile = new Document(dataDir + "Aspose.one");
dataDir = dataDir + "SaveAsGrayscaleImage_out.png";
// Save the document as gif.
oneFile.Save(dataDir, new ImageSaveOptions(SaveFormat.Png)
{
ColorMode = ColorMode.GrayScale
});
Hiển thị cách lưu một tài liệu như một hình ảnh trong định dạng Tiff bằng cách sử dụng CCITT Group 3 fax compression.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
// Load the document into Aspose.Note.
Document oneFile = new Document(Path.Combine(dataDir, "Aspose.one"));
var dst = Path.Combine(dataDir, "SaveToTiffUsingCcitt3Compression.tiff");
// Save the document.
oneFile.Save(dst, new ImageSaveOptions(SaveFormat.Tiff)
{
ColorMode = ColorMode.BlackAndWhite,
TiffCompression = TiffCompression.Ccitt3
});
Hiển thị cách lưu một tài liệu như một hình ảnh nhị phân bằng cách sử dụng phương pháp của Otsu.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
// Load the document into Aspose.Note.
Document oneFile = new Document(dataDir + "Aspose.one");
dataDir = dataDir + "SaveToBinaryImageUsingOtsuMethod_out.png";
// Save the document as gif.
oneFile.Save(dataDir, new ImageSaveOptions(SaveFormat.Png)
{
ColorMode = ColorMode.BlackAndWhite,
BinarizationOptions = new ImageBinarizationOptions()
{
BinarizationMethod = BinarizationMethod.Otsu,
}
});
Hiển thị cách lưu một tài liệu như một hình ảnh nhị phân bằng cách sử dụng giới hạn cố định.
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
// Load the document into Aspose.Note.
Document oneFile = new Document(dataDir + "Aspose.one");
dataDir = dataDir + "SaveToBinaryImageUsingFixedThreshold_out.png";
// Save the document as gif.
oneFile.Save(dataDir, new ImageSaveOptions(SaveFormat.Png)
{
ColorMode = ColorMode.BlackAndWhite,
BinarizationOptions = new ImageBinarizationOptions()
{
BinarizationMethod = BinarizationMethod.FixedThreshold,
BinarizationThreshold = 123
}
});