Class TiffOptions
نام ها : Aspose.Imaging.ImageOptions جمع آوری: Aspose.Imaging.dll (25.4.0)
گزینه های فرمت فایل تیفتوجه داشته باشید که برچسب های عرض و ارتفاع بر روی ایجاد تصویر با پارامترهای عرض و ارتفاع نوشته می شوند، بنابراین نیازی به مشخص کردن آنها به طور مستقیم نیست.توجه داشته باشید که بسیاری از گزینه ها ارزش پیش فرض را باز می گردانند اما این بدان معنا نیست که این گزینه به صراحت به عنوان یک ارزش برچسب تنظیم شده است.
[JsonObject(MemberSerialization.OptIn)]
public class TiffOptions : ImageOptionsBase, IDisposable, ICloneable, IHasExifData, IHasXmpData, IHasMetadata
Inheritance
object ← DisposableObject ← ImageOptionsBase ← TiffOptions
Derived
Implements
IDisposable , ICloneable , IHasExifData , IHasXmpData , IHasMetadata
اعضای ارثی
ImageOptionsBase.Clone() , ImageOptionsBase.ReleaseManagedResources() , ImageOptionsBase.KeepMetadata , ImageOptionsBase.XmpData , ImageOptionsBase.Source , ImageOptionsBase.Palette , ImageOptionsBase.ResolutionSettings , ImageOptionsBase.VectorRasterizationOptions , ImageOptionsBase.BufferSizeHint , ImageOptionsBase.MultiPageOptions , ImageOptionsBase.FullFrame , ImageOptionsBase.ProgressEventHandler , DisposableObject.Dispose() , DisposableObject.ReleaseManagedResources() , DisposableObject.ReleaseUnmanagedResources() , DisposableObject.VerifyNotDisposed() , DisposableObject.Disposed , object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
این مثال نشان دهنده استفاده از کلاس های مختلف از SaveOptions Namespace برای اهداف صادرات است.یک تصویر از نوع Gif به یک مثال از تصویر بارگذاری می شود و سپس به فرمت های مختلف صادر می شود.
string dir = "c:\\temp\\";
//Load an existing image (of type Gif) in an instance of Image class
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
{
//Export to BMP file format using the default options
image.Save(dir + "output.bmp", new Aspose.Imaging.ImageOptions.BmpOptions());
//Export to JPEG file format using the default options
image.Save(dir + "output.jpg", new Aspose.Imaging.ImageOptions.JpegOptions());
//Export to PNG file format using the default options
image.Save(dir + "output.png", new Aspose.Imaging.ImageOptions.PngOptions());
//Export to TIFF file format using the default options
image.Save(dir + "output.tif", new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default));
}
مثال زیر نشان می دهد که چگونه یک تصویر چند صفحه وکتور را به فرمت TIFF به طور کلی بدون اشاره به یک نوع تصویر خاص تبدیل کنیم.
string dir = "C:\\aspose.imaging\\net\\misc\\ImagingReleaseQATester\\Tests\\testdata\\2548";
string inputFilePath = System.IO.Path.Combine(dir, "Multipage.cdr");
string outputFilePath = System.IO.Path.Combine(dir, "Multipage.cdr.tiff");
Aspose.Imaging.ImageOptionsBase exportOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(inputFilePath))
{
exportOptions.MultiPageOptions = null;
// Export only first two pages. These pages will be presented as frames in the output TIFF.
Aspose.Imaging.IMultipageImage multipageImage = image as Aspose.Imaging.IMultipageImage;
if (multipageImage != null && (multipageImage.Pages != null && multipageImage.PageCount > 2))
{
exportOptions.MultiPageOptions = new Aspose.Imaging.ImageOptions.MultiPageOptions(new Aspose.Imaging.IntRange(0, 2));
}
if (image is Aspose.Imaging.VectorImage)
{
exportOptions.VectorRasterizationOptions = (Aspose.Imaging.ImageOptions.VectorRasterizationOptions)image.GetDefaultOptions(new object[] { Aspose.Imaging.Color.White, image.Width, image.Height });
exportOptions.VectorRasterizationOptions.TextRenderingHint = Aspose.Imaging.TextRenderingHint.SingleBitPerPixel;
exportOptions.VectorRasterizationOptions.SmoothingMode = Aspose.Imaging.SmoothingMode.None;
}
image.Save(outputFilePath, exportOptions);
}
این نمونه ها از کلاس GraphicsPath و Graphics استفاده می کنند تا شکل ها را در یک سطح تصویر ایجاد و دستکاری کنند. نمونه یک تصویر جدید (نوع Tiff) ایجاد می کند، سطح را پاک می کند و مسیرها را با استفاده از کلاس GraphicsPath کشیده است.
//Create an instance of FileStream
using (System.IO.FileStream stream = new System.IO.FileStream(@"C:\temp\output.tiff", System.IO.FileMode.Create))
{
//Create an instance of TiffOptions and set its various properties
Aspose.Imaging.ImageOptions.TiffOptions tiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
//Set the source for the instance of ImageOptions
tiffOptions.Source = new Aspose.Imaging.Sources.StreamSource(stream);
//Create an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(tiffOptions, 500, 500))
{
//Create and initialize an instance of Graphics class
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear Graphics surface
graphics.Clear(Color.Wheat);
//Create an instance of GraphicsPath class
Aspose.Imaging.GraphicsPath graphicspath = new Aspose.Imaging.GraphicsPath();
//Create an instance of Figure class
Aspose.Imaging.Figure figure = new Aspose.Imaging.Figure();
//Add Shapes to Figure object
figure.AddShape(new Aspose.Imaging.Shapes.RectangleShape(new Aspose.Imaging.RectangleF(10f, 10f, 300f, 300f)));
figure.AddShape(new Aspose.Imaging.Shapes.EllipseShape(new Aspose.Imaging.RectangleF(50f, 50f, 300f, 300f)));
figure.AddShape(new Aspose.Imaging.Shapes.PieShape(new Aspose.Imaging.RectangleF(new Aspose.Imaging.PointF(250f, 250f), new Aspose.Imaging.SizeF(200f, 200f)), 0f, 45f));
//Add Figure object to GraphicsPath
graphicspath.AddFigure(figure);
//Draw path with Pen object of color Black
graphics.DrawPath(new Aspose.Imaging.Pen(Aspose.Imaging.Color.Black, 2), graphicspath);
// save all changes.
image.Save();
}
}
Constructors
TiffOptions(بایگانی برچسب ها: TiffByteOrder)
شروع یک مثال جدید از کلاس Aspose.Imaging.ImageOptions.TiffOptions.
public TiffOptions(TiffExpectedFormat expectedFormat, TiffByteOrder byteOrder)
Parameters
expectedFormat
TiffExpectedFormat
فرمت فایل انتظار می رود.
byteOrder
TiffByteOrder
فرمت فایل بایت برای استفاده است.
TiffOptions(TiffExpectedFormat)
یک مثال جدید از کلاس Aspose.Imaging.ImageOptions.TiffOptions آغاز می شود.
public TiffOptions(TiffExpectedFormat expectedFormat)
Parameters
expectedFormat
TiffExpectedFormat
فرمت فایل انتظار می رود.
Examples
مثال زیر نشان می دهد که چگونه یک کپی در مقیاس خاکستری از یک چارچوب موجود ایجاد کنید و آن را به یک تصویر TIFF اضافه کنید.
string dir = "c:\\temp\\";
Aspose.Imaging.ImageOptions.TiffOptions createTiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Create a permanent, not temporary file source.
createTiffOptions.Source = new Aspose.Imaging.Sources.FileCreateSource(dir + "multipage.tif", false);
createTiffOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
createTiffOptions.BitsPerSample = new ushort[] { 8, 8, 8 };
using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Image.Create(createTiffOptions, 100, 100))
{
// The linear gradient from the left-top to the right-bottom corner of the image.
Aspose.Imaging.Brushes.LinearGradientBrush brush =
new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(tiffImage.Width, tiffImage.Height),
Aspose.Imaging.Color.Red,
Aspose.Imaging.Color.Green);
// Fill the active frame with a linear gradient brush.
Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(tiffImage.ActiveFrame);
gr.FillRectangle(brush, tiffImage.Bounds);
// Grayscale options
Aspose.Imaging.ImageOptions.TiffOptions createTiffFrameOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
createTiffFrameOptions.Source = new Aspose.Imaging.Sources.StreamSource(new System.IO.MemoryStream());
createTiffFrameOptions.Photometric = Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.MinIsBlack;
createTiffFrameOptions.BitsPerSample = new ushort[] { 8 };
// Create a grayscale copy of the active frame.
// The pixel data is preserved but converted to the desired format.
Aspose.Imaging.FileFormats.Tiff.TiffFrame grayscaleFrame = Aspose.Imaging.FileFormats.Tiff.TiffFrame.CreateFrameFrom(tiffImage.ActiveFrame, createTiffFrameOptions);
// Add the newly created frame to the TIFF image.
tiffImage.AddFrame(grayscaleFrame);
tiffImage.Save();
}
این مثال نشان می دهد که چگونه یک تصویر راستر را در فرمت TIFF با استفاده از گزینه های مختلف ذخیره کنید.
string dir = "c:\\temp\\";
Aspose.Imaging.ImageOptions.TiffOptions saveOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 8 bits for each color component.
saveOptions.BitsPerSample = new ushort[] { 8, 8, 8 };
// Set the Big Endian byte order (Motorola)
saveOptions.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.BigEndian;
// Set the LZW compression.
saveOptions.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.Lzw;
// Allow to reduce the size of continuous-tone images.
// Currently this field is used only with LZW encoding because LZW is probably the only TIFF encoding scheme
// that benefits significantly from a predictor step.
saveOptions.Predictor = Imaging.FileFormats.Tiff.Enums.TiffPredictor.Horizontal;
// Set the RGB color model.
saveOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
// For YCbCr, you can use one of the following choices:
// YCbCrSubSampling field JPEG sampling factors
// ----------------------------------------------
// 1,1 1x1, 1x1, 1x1
// 2,1 2x1, 1x1, 1x1
// 2,2(default value) 2x2, 1x1, 1x1
// saveOptions.YCbCrSubsampling = new ushort[] { 2, 2 };
// All color components will be stored within a singel plane.
saveOptions.PlanarConfiguration = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPlanarConfigs.Contiguous;
// Create a TIFF Frame of 100x100 px.
using (Aspose.Imaging.Image image = new Aspose.Imaging.FileFormats.Bmp.BmpImage(100, 100))
{
// Fill the entire image with the blue-yellow gradient.
Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(image.Width, image.Height),
Aspose.Imaging.Color.Blue,
Aspose.Imaging.Color.Yellow);
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
graphics.FillRectangle(gradientBrush, image.Bounds);
image.Save(dir + "output.tif", saveOptions);
}
TiffOptions(TiffOptions)
شروع یک مثال جدید از کلاس Aspose.Imaging.ImageOptions.TiffOptions.
public TiffOptions(TiffOptions options)
Parameters
options
TiffOptions
گزینه هایی برای کپی کردن
TiffOptions(TiffDataType[])
شروع یک مثال جدید از کلاس Aspose.Imaging.ImageOptions.TiffOptions.
public TiffOptions(TiffDataType[] tags)
Parameters
tags
TiffDataType
[ ]
برچسب ها برای شروع گزینه ها با.
Properties
AlphaStorage
گزینه های غیر از Aspose.Imaging.FileFormats.Tiff.Enums.TiffAlphaStorage.Unspecifiedاستفاده می شود زمانی که بیش از 3 Aspose.Imaging.ImageOptions.TiffOptions.SamplesPerPixel تعریف شده است.
public TiffAlphaStorage AlphaStorage { get; set; }
ارزش املاک
Artist
هنرمند را می گیرد یا می گیرد.
public string Artist { get; set; }
ارزش املاک
BitsPerPixel
بایت ها را در هر پیکسل دریافت کنید.
public int BitsPerPixel { get; }
ارزش املاک
BitsPerSample
دریافت و یا قرار دادن بیتی ها در هر نمونه.
public ushort[] BitsPerSample { get; set; }
ارزش املاک
ushort [ ]
Examples
این مثال نشان می دهد که چگونه یک تصویر TIFF را از خراش ایجاد کنید و آن را به یک فایل ذخیره کنید.
string dir = "c:\\temp\\";
Aspose.Imaging.ImageOptions.TiffOptions createOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 8 bits for each color component.
createOptions.BitsPerSample = new ushort[] { 8, 8, 8 };
// Set the Big Endian byte order (Motorola)
createOptions.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.BigEndian;
// Set the LZW compression.
createOptions.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.Lzw;
// Set the RGB color model.
createOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
// All color components will be stored within a single plane.
createOptions.PlanarConfiguration = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPlanarConfigs.Contiguous;
// Create a TIFF Frame of 100x100 px.
// Note that you don't have to dispose a frame explicitly if it is included into TiffImage.
// When the container is disposed all frames will be disposed automatically.
Aspose.Imaging.FileFormats.Tiff.TiffFrame firstFrame = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(createOptions, 100, 100);
// Fill the entire frame with the blue-yellow gradient.
Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(firstFrame.Width, firstFrame.Height),
Aspose.Imaging.Color.Blue,
Aspose.Imaging.Color.Yellow);
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(firstFrame);
graphics.FillRectangle(gradientBrush, firstFrame.Bounds);
// Create a TIFF image.
using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = new Aspose.Imaging.FileFormats.Tiff.TiffImage(firstFrame))
{
tiffImage.Save(dir + "output.tif");
}
مثال زیر نشان می دهد که چگونه می توان یک TIFF مخلوط را از تصاویری راستر فردی تشکیل داد.
Aspose.Imaging.ImageOptions.TiffOptions createTiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
createTiffOptions.Source = new Aspose.Imaging.Sources.FileCreateSource("c:\\temp\\multipage.tif", false);
createTiffOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
createTiffOptions.BitsPerSample = new ushort[] { 8, 8, 8 };
using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Image.Create(createTiffOptions, 100, 100))
{
// This is Font and Brush for drawing text on individual frames.
Aspose.Imaging.Font font = new Aspose.Imaging.Font("Arial", 64);
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.White);
// Create 5 frames
for (int i = 1; i <= 5; i++)
{
Aspose.Imaging.ImageOptions.PngOptions createPngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
createPngOptions.Source = new Aspose.Imaging.Sources.StreamSource(new System.IO.MemoryStream());
// Create a PNG image and draw the number of page on it.
Aspose.Imaging.FileFormats.Png.PngImage pngImage = (Aspose.Imaging.FileFormats.Png.PngImage)Image.Create(createPngOptions, 100, 100);
Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(pngImage);
gr.DrawString(i.ToString(), font, brush, 10, 10);
// Create a frame based on the PNG image.
Aspose.Imaging.FileFormats.Tiff.TiffFrame frame = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(pngImage);
// Add the frame to the TIFF image.
tiffImage.AddFrame(frame);
}
// The image was created with a single default frame. Let's remove it.
Aspose.Imaging.FileFormats.Tiff.TiffFrame activeFrame = tiffImage.ActiveFrame;
tiffImage.ActiveFrame = tiffImage.Frames[1];
tiffImage.RemoveFrame(0);
// Don't forget to dispose the frame if you won't add it to some other TiffImage
activeFrame.Dispose();
tiffImage.Save();
}
مثال زیر نشان می دهد که چگونه یک کپی در مقیاس خاکستری از یک چارچوب موجود ایجاد کنید و آن را به یک تصویر TIFF اضافه کنید.
string dir = "c:\\temp\\";
Aspose.Imaging.ImageOptions.TiffOptions createTiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Create a permanent, not temporary file source.
createTiffOptions.Source = new Aspose.Imaging.Sources.FileCreateSource(dir + "multipage.tif", false);
createTiffOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
createTiffOptions.BitsPerSample = new ushort[] { 8, 8, 8 };
using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Image.Create(createTiffOptions, 100, 100))
{
// The linear gradient from the left-top to the right-bottom corner of the image.
Aspose.Imaging.Brushes.LinearGradientBrush brush =
new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(tiffImage.Width, tiffImage.Height),
Aspose.Imaging.Color.Red,
Aspose.Imaging.Color.Green);
// Fill the active frame with a linear gradient brush.
Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(tiffImage.ActiveFrame);
gr.FillRectangle(brush, tiffImage.Bounds);
// Grayscale options
Aspose.Imaging.ImageOptions.TiffOptions createTiffFrameOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
createTiffFrameOptions.Source = new Aspose.Imaging.Sources.StreamSource(new System.IO.MemoryStream());
createTiffFrameOptions.Photometric = Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.MinIsBlack;
createTiffFrameOptions.BitsPerSample = new ushort[] { 8 };
// Create a grayscale copy of the active frame.
// The pixel data is preserved but converted to the desired format.
Aspose.Imaging.FileFormats.Tiff.TiffFrame grayscaleFrame = Aspose.Imaging.FileFormats.Tiff.TiffFrame.CreateFrameFrom(tiffImage.ActiveFrame, createTiffFrameOptions);
// Add the newly created frame to the TIFF image.
tiffImage.AddFrame(grayscaleFrame);
tiffImage.Save();
}
این مثال نشان می دهد که چگونه یک تصویر راستر را در فرمت TIFF با استفاده از گزینه های مختلف ذخیره کنید.
string dir = "c:\\temp\\";
Aspose.Imaging.ImageOptions.TiffOptions saveOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 8 bits for each color component.
saveOptions.BitsPerSample = new ushort[] { 8, 8, 8 };
// Set the Big Endian byte order (Motorola)
saveOptions.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.BigEndian;
// Set the LZW compression.
saveOptions.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.Lzw;
// Allow to reduce the size of continuous-tone images.
// Currently this field is used only with LZW encoding because LZW is probably the only TIFF encoding scheme
// that benefits significantly from a predictor step.
saveOptions.Predictor = Imaging.FileFormats.Tiff.Enums.TiffPredictor.Horizontal;
// Set the RGB color model.
saveOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
// For YCbCr, you can use one of the following choices:
// YCbCrSubSampling field JPEG sampling factors
// ----------------------------------------------
// 1,1 1x1, 1x1, 1x1
// 2,1 2x1, 1x1, 1x1
// 2,2(default value) 2x2, 1x1, 1x1
// saveOptions.YCbCrSubsampling = new ushort[] { 2, 2 };
// All color components will be stored within a singel plane.
saveOptions.PlanarConfiguration = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPlanarConfigs.Contiguous;
// Create a TIFF Frame of 100x100 px.
using (Aspose.Imaging.Image image = new Aspose.Imaging.FileFormats.Bmp.BmpImage(100, 100))
{
// Fill the entire image with the blue-yellow gradient.
Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(image.Width, image.Height),
Aspose.Imaging.Color.Blue,
Aspose.Imaging.Color.Yellow);
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
graphics.FillRectangle(gradientBrush, image.Bounds);
image.Save(dir + "output.tif", saveOptions);
}
این مثال نشان می دهد که چگونه یک تصویر TIFF با 2 چارچوب ایجاد کنید و آن را به یک فایل ذخیره کنید.
string dir = "c:\\temp\\";
// Options for the first frame
Aspose.Imaging.ImageOptions.TiffOptions createOptions1 = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 8 bits for each color component.
createOptions1.BitsPerSample = new ushort[] { 8, 8, 8 };
// Set the Big Endian byte order (Motorola)
createOptions1.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.BigEndian;
// Set the LZW compression.
createOptions1.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.Lzw;
// Set the RGB color model.
createOptions1.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
// All color components will be stored within a single plane.
createOptions1.PlanarConfiguration = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPlanarConfigs.Contiguous;
// Create the first TIFF frame of 100x100 px.
// Note that you don't have to dispose frames explicitly if they are included into TiffImage.
// When the container is disposed all frames will be disposed automatically.
Aspose.Imaging.FileFormats.Tiff.TiffFrame frame1 = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(createOptions1, 100, 100);
// Fill the first frame with the blue-yellow gradient.
Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(frame1.Width, frame1.Height),
Aspose.Imaging.Color.Blue,
Aspose.Imaging.Color.Yellow);
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(frame1);
graphics.FillRectangle(gradientBrush, frame1.Bounds);
// Options for the first frame
Aspose.Imaging.ImageOptions.TiffOptions createOptions2 = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 1 bit per pixel for a B/W image.
createOptions2.BitsPerSample = new ushort[] { 1 };
// Set the Little Endian byte order (Intel)
createOptions2.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.LittleEndian;
// Set the CCITT Group 3 Fax compression.
createOptions2.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.CcittFax3;
// Set the B/W color model where 0 is black, 1 is white.
createOptions2.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.MinIsBlack;
// Create the second TIFF frame of 200x200px.
Aspose.Imaging.FileFormats.Tiff.TiffFrame frame2 = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(createOptions2, 200, 200);
// Fill the second frame with the blue-yellow gradient.
// It will be automatically converted to the B/W format due to the corresponding settings of the frame.
Aspose.Imaging.Graphics graphics2 = new Aspose.Imaging.Graphics(frame2);
graphics2.FillRectangle(gradientBrush, frame2.Bounds);
// Create a TIFF image.
using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = new Aspose.Imaging.FileFormats.Tiff.TiffImage(
new Aspose.Imaging.FileFormats.Tiff.TiffFrame[] { frame1, frame2 }))
{
tiffImage.Save(dir + "output.mutliframe.tif");
}
Remarks
هنگامی که این مقدار را تنظیم می کنید، به یاد داشته باشید که آن را نیز مقدار نمونهPerPixel را برای تنظیم طول تنظیم می کند. این 2 ویژگی ها به شدت به هم پیوسته است بنابراین می تواند به طور کامل تنظیم شود.
ByteOrder
دریافت یا تنظیم یک مقدار نشان دهنده سفارش بایت تایف.
public TiffByteOrder ByteOrder { get; set; }
ارزش املاک
Examples
این مثال نشان می دهد که چگونه یک تصویر TIFF را از خراش ایجاد کنید و آن را به یک فایل ذخیره کنید.
string dir = "c:\\temp\\";
Aspose.Imaging.ImageOptions.TiffOptions createOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 8 bits for each color component.
createOptions.BitsPerSample = new ushort[] { 8, 8, 8 };
// Set the Big Endian byte order (Motorola)
createOptions.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.BigEndian;
// Set the LZW compression.
createOptions.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.Lzw;
// Set the RGB color model.
createOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
// All color components will be stored within a single plane.
createOptions.PlanarConfiguration = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPlanarConfigs.Contiguous;
// Create a TIFF Frame of 100x100 px.
// Note that you don't have to dispose a frame explicitly if it is included into TiffImage.
// When the container is disposed all frames will be disposed automatically.
Aspose.Imaging.FileFormats.Tiff.TiffFrame firstFrame = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(createOptions, 100, 100);
// Fill the entire frame with the blue-yellow gradient.
Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(firstFrame.Width, firstFrame.Height),
Aspose.Imaging.Color.Blue,
Aspose.Imaging.Color.Yellow);
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(firstFrame);
graphics.FillRectangle(gradientBrush, firstFrame.Bounds);
// Create a TIFF image.
using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = new Aspose.Imaging.FileFormats.Tiff.TiffImage(firstFrame))
{
tiffImage.Save(dir + "output.tif");
}
این مثال نشان می دهد که چگونه یک تصویر راستر را در فرمت TIFF با استفاده از گزینه های مختلف ذخیره کنید.
string dir = "c:\\temp\\";
Aspose.Imaging.ImageOptions.TiffOptions saveOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 8 bits for each color component.
saveOptions.BitsPerSample = new ushort[] { 8, 8, 8 };
// Set the Big Endian byte order (Motorola)
saveOptions.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.BigEndian;
// Set the LZW compression.
saveOptions.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.Lzw;
// Allow to reduce the size of continuous-tone images.
// Currently this field is used only with LZW encoding because LZW is probably the only TIFF encoding scheme
// that benefits significantly from a predictor step.
saveOptions.Predictor = Imaging.FileFormats.Tiff.Enums.TiffPredictor.Horizontal;
// Set the RGB color model.
saveOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
// For YCbCr, you can use one of the following choices:
// YCbCrSubSampling field JPEG sampling factors
// ----------------------------------------------
// 1,1 1x1, 1x1, 1x1
// 2,1 2x1, 1x1, 1x1
// 2,2(default value) 2x2, 1x1, 1x1
// saveOptions.YCbCrSubsampling = new ushort[] { 2, 2 };
// All color components will be stored within a singel plane.
saveOptions.PlanarConfiguration = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPlanarConfigs.Contiguous;
// Create a TIFF Frame of 100x100 px.
using (Aspose.Imaging.Image image = new Aspose.Imaging.FileFormats.Bmp.BmpImage(100, 100))
{
// Fill the entire image with the blue-yellow gradient.
Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(image.Width, image.Height),
Aspose.Imaging.Color.Blue,
Aspose.Imaging.Color.Yellow);
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
graphics.FillRectangle(gradientBrush, image.Bounds);
image.Save(dir + "output.tif", saveOptions);
}
این مثال نشان می دهد که چگونه یک تصویر TIFF با 2 چارچوب ایجاد کنید و آن را به یک فایل ذخیره کنید.
string dir = "c:\\temp\\";
// Options for the first frame
Aspose.Imaging.ImageOptions.TiffOptions createOptions1 = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 8 bits for each color component.
createOptions1.BitsPerSample = new ushort[] { 8, 8, 8 };
// Set the Big Endian byte order (Motorola)
createOptions1.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.BigEndian;
// Set the LZW compression.
createOptions1.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.Lzw;
// Set the RGB color model.
createOptions1.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
// All color components will be stored within a single plane.
createOptions1.PlanarConfiguration = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPlanarConfigs.Contiguous;
// Create the first TIFF frame of 100x100 px.
// Note that you don't have to dispose frames explicitly if they are included into TiffImage.
// When the container is disposed all frames will be disposed automatically.
Aspose.Imaging.FileFormats.Tiff.TiffFrame frame1 = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(createOptions1, 100, 100);
// Fill the first frame with the blue-yellow gradient.
Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(frame1.Width, frame1.Height),
Aspose.Imaging.Color.Blue,
Aspose.Imaging.Color.Yellow);
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(frame1);
graphics.FillRectangle(gradientBrush, frame1.Bounds);
// Options for the first frame
Aspose.Imaging.ImageOptions.TiffOptions createOptions2 = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 1 bit per pixel for a B/W image.
createOptions2.BitsPerSample = new ushort[] { 1 };
// Set the Little Endian byte order (Intel)
createOptions2.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.LittleEndian;
// Set the CCITT Group 3 Fax compression.
createOptions2.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.CcittFax3;
// Set the B/W color model where 0 is black, 1 is white.
createOptions2.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.MinIsBlack;
// Create the second TIFF frame of 200x200px.
Aspose.Imaging.FileFormats.Tiff.TiffFrame frame2 = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(createOptions2, 200, 200);
// Fill the second frame with the blue-yellow gradient.
// It will be automatically converted to the B/W format due to the corresponding settings of the frame.
Aspose.Imaging.Graphics graphics2 = new Aspose.Imaging.Graphics(frame2);
graphics2.FillRectangle(gradientBrush, frame2.Bounds);
// Create a TIFF image.
using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = new Aspose.Imaging.FileFormats.Tiff.TiffImage(
new Aspose.Imaging.FileFormats.Tiff.TiffFrame[] { frame1, frame2 }))
{
tiffImage.Save(dir + "output.mutliframe.tif");
}
ColorMap
دریافت یا قرار دادن نقشه رنگی.
public ushort[] ColorMap { get; set; }
ارزش املاک
ushort [ ]
Exceptions
ارزش
نقشه رنگی را می توان برای نمونه ها در هر پیکسل به اندازه 1 تعریف کرد.یابیتی ها در هر نمونه تعریف نشده اند.
ارزش؛ طول محدوده باید با فرمول پیگیری مطابقت داشته باشد: 3 * (2**BitsPerSample).
CompressedQuality
دریافت یا تنظیم کیفیت تصویر فشرده.با استفاده از فشرده سازی JPEG
public int CompressedQuality { get; set; }
ارزش املاک
Examples
این مثال نشان می دهد که چگونه یک تصویر TIFF را با فشرده سازی Jpeg و کیفیت تصویر فشرده مشخص کنید.
using (Aspose.Imaging.FileFormats.Tiff.TiffImage image = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Aspose.Imaging.Image.Load("c:\\temp\\zeebra.tif"))
{
Aspose.Imaging.ImageOptions.TiffOptions tiffOptions = new TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set the RGB color model.
tiffOptions.Photometric = TiffPhotometrics.Rgb;
// Set the Jpeg compression.
tiffOptions.Compression = TiffCompressions.Jpeg;
tiffOptions.CompressedQuality = 50;
// Set 8 bits for each color component.
tiffOptions.BitsPerSample = new ushort[] { 8, 8, 8 };
image.Save("zeebra.tif-50.tiff", tiffOptions);
}
Compression
فشرده یا فشرده می شود.
public TiffCompressions Compression { get; set; }
ارزش املاک
Examples
این مثال نشان می دهد که چگونه یک تصویر TIFF را از خراش ایجاد کنید و آن را به یک فایل ذخیره کنید.
string dir = "c:\\temp\\";
Aspose.Imaging.ImageOptions.TiffOptions createOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 8 bits for each color component.
createOptions.BitsPerSample = new ushort[] { 8, 8, 8 };
// Set the Big Endian byte order (Motorola)
createOptions.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.BigEndian;
// Set the LZW compression.
createOptions.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.Lzw;
// Set the RGB color model.
createOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
// All color components will be stored within a single plane.
createOptions.PlanarConfiguration = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPlanarConfigs.Contiguous;
// Create a TIFF Frame of 100x100 px.
// Note that you don't have to dispose a frame explicitly if it is included into TiffImage.
// When the container is disposed all frames will be disposed automatically.
Aspose.Imaging.FileFormats.Tiff.TiffFrame firstFrame = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(createOptions, 100, 100);
// Fill the entire frame with the blue-yellow gradient.
Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(firstFrame.Width, firstFrame.Height),
Aspose.Imaging.Color.Blue,
Aspose.Imaging.Color.Yellow);
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(firstFrame);
graphics.FillRectangle(gradientBrush, firstFrame.Bounds);
// Create a TIFF image.
using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = new Aspose.Imaging.FileFormats.Tiff.TiffImage(firstFrame))
{
tiffImage.Save(dir + "output.tif");
}
این مثال نشان می دهد که چگونه یک تصویر راستر را در فرمت TIFF با استفاده از گزینه های مختلف ذخیره کنید.
string dir = "c:\\temp\\";
Aspose.Imaging.ImageOptions.TiffOptions saveOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 8 bits for each color component.
saveOptions.BitsPerSample = new ushort[] { 8, 8, 8 };
// Set the Big Endian byte order (Motorola)
saveOptions.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.BigEndian;
// Set the LZW compression.
saveOptions.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.Lzw;
// Allow to reduce the size of continuous-tone images.
// Currently this field is used only with LZW encoding because LZW is probably the only TIFF encoding scheme
// that benefits significantly from a predictor step.
saveOptions.Predictor = Imaging.FileFormats.Tiff.Enums.TiffPredictor.Horizontal;
// Set the RGB color model.
saveOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
// For YCbCr, you can use one of the following choices:
// YCbCrSubSampling field JPEG sampling factors
// ----------------------------------------------
// 1,1 1x1, 1x1, 1x1
// 2,1 2x1, 1x1, 1x1
// 2,2(default value) 2x2, 1x1, 1x1
// saveOptions.YCbCrSubsampling = new ushort[] { 2, 2 };
// All color components will be stored within a singel plane.
saveOptions.PlanarConfiguration = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPlanarConfigs.Contiguous;
// Create a TIFF Frame of 100x100 px.
using (Aspose.Imaging.Image image = new Aspose.Imaging.FileFormats.Bmp.BmpImage(100, 100))
{
// Fill the entire image with the blue-yellow gradient.
Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(image.Width, image.Height),
Aspose.Imaging.Color.Blue,
Aspose.Imaging.Color.Yellow);
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
graphics.FillRectangle(gradientBrush, image.Bounds);
image.Save(dir + "output.tif", saveOptions);
}
این مثال نشان می دهد که چگونه یک تصویر TIFF با 2 چارچوب ایجاد کنید و آن را به یک فایل ذخیره کنید.
string dir = "c:\\temp\\";
// Options for the first frame
Aspose.Imaging.ImageOptions.TiffOptions createOptions1 = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 8 bits for each color component.
createOptions1.BitsPerSample = new ushort[] { 8, 8, 8 };
// Set the Big Endian byte order (Motorola)
createOptions1.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.BigEndian;
// Set the LZW compression.
createOptions1.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.Lzw;
// Set the RGB color model.
createOptions1.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
// All color components will be stored within a single plane.
createOptions1.PlanarConfiguration = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPlanarConfigs.Contiguous;
// Create the first TIFF frame of 100x100 px.
// Note that you don't have to dispose frames explicitly if they are included into TiffImage.
// When the container is disposed all frames will be disposed automatically.
Aspose.Imaging.FileFormats.Tiff.TiffFrame frame1 = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(createOptions1, 100, 100);
// Fill the first frame with the blue-yellow gradient.
Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(frame1.Width, frame1.Height),
Aspose.Imaging.Color.Blue,
Aspose.Imaging.Color.Yellow);
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(frame1);
graphics.FillRectangle(gradientBrush, frame1.Bounds);
// Options for the first frame
Aspose.Imaging.ImageOptions.TiffOptions createOptions2 = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 1 bit per pixel for a B/W image.
createOptions2.BitsPerSample = new ushort[] { 1 };
// Set the Little Endian byte order (Intel)
createOptions2.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.LittleEndian;
// Set the CCITT Group 3 Fax compression.
createOptions2.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.CcittFax3;
// Set the B/W color model where 0 is black, 1 is white.
createOptions2.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.MinIsBlack;
// Create the second TIFF frame of 200x200px.
Aspose.Imaging.FileFormats.Tiff.TiffFrame frame2 = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(createOptions2, 200, 200);
// Fill the second frame with the blue-yellow gradient.
// It will be automatically converted to the B/W format due to the corresponding settings of the frame.
Aspose.Imaging.Graphics graphics2 = new Aspose.Imaging.Graphics(frame2);
graphics2.FillRectangle(gradientBrush, frame2.Bounds);
// Create a TIFF image.
using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = new Aspose.Imaging.FileFormats.Tiff.TiffImage(
new Aspose.Imaging.FileFormats.Tiff.TiffFrame[] { frame1, frame2 }))
{
tiffImage.Save(dir + "output.mutliframe.tif");
}
Copyright
حق کپی رایت را دریافت یا تنظیم کنید.
public string Copyright { get; set; }
ارزش املاک
DateTime
دریافت یا تعیین تاریخ و زمان.
public string DateTime { get; set; }
ارزش املاک
DefaultMemoryAllocationLimit
دریافت یا تنظیم محدودیت اختصاص حافظه پیش فرض.
[Obsolete("Use Aspose.Imaging.Image.BufferSizeHint, Aspose.Imaging.ImageOptionsBase.BufferSizeHint or Aspose.Imaging.LoadOptions.BufferSizeHint instead.")]
public int DefaultMemoryAllocationLimit { get; set; }
ارزش املاک
DisableIccExport
دریافت یا تنظیم یک مقدار نشان می دهد که آیا صادرات پروفایل ICC غیرفعال شده است ( پروفایل ICC به پیکسل های منبع از قبل اعمال می شود).
[JsonProperty]
public bool DisableIccExport { get; set; }
ارزش املاک
DocumentName
دریافت یا نام سند را وارد کنید.
public string DocumentName { get; set; }
ارزش املاک
ExifData
دریافت و یا تنظیم داده های Exif.
public ExifData ExifData { get; set; }
ارزش املاک
ExifIfd
دریافت یا قرار دادن شاخص به EXIF IFD.
public TiffExifIfd ExifIfd { get; }
ارزش املاک
ExtraSamples
ارزش های اضافی نمونه را دریافت کنید.
public ushort[] ExtraSamples { get; }
ارزش املاک
ushort [ ]
FaxT4Options
گزینه های T4 را دریافت یا تنظیم کنید.
public Group3Options FaxT4Options { get; set; }
ارزش املاک
FileStandard
دریافت یا تنظیم استاندارد فایل TIFF.
public TiffFileStandards FileStandard { get; set; }
ارزش املاک
FillOrder
دریافت و یا قرار دادن بایت بایت پر کردن سفارش.
public TiffFillOrders FillOrder { get; set; }
ارزش املاک
HalfToneHints
نمره یا نمره نمره نمره نمره نمره
public ushort[] HalfToneHints { get; set; }
ارزش املاک
ushort [ ]
Exceptions
ارزش
نمره نمره نمره نمره نمره نمره نمره نمره 2
IccProfile
دریافت یا تنظیم جریان پروفایل Icc.
public MemoryStream IccProfile { get; set; }
ارزش املاک
ImageDescription
یا توصیف تصویر را به دست آورید.
public string ImageDescription { get; set; }
ارزش املاک
ImageLength
طول تصویر را دریافت یا تنظیم کنید.
public uint ImageLength { get; set; }
ارزش املاک
ImageWidth
تصویر را در عرض یا عرض قرار دهید.
public uint ImageWidth { get; set; }
ارزش املاک
InkNames
نام ها را وارد کنید یا آن ها را وارد کنید.
public string InkNames { get; set; }
ارزش املاک
IsExtraSamplesPresent
یک مقدار دریافت می کند که نشان می دهد آیا نمونه های اضافی وجود دارد.
public bool IsExtraSamplesPresent { get; }
ارزش املاک
IsTiled
یک مقدار را نشان می دهد که آیا تصویر در نظر گرفته شده است یا خیر.
public bool IsTiled { get; }
ارزش املاک
IsValid
دریافت ارزش نشان می دهد که آیا Aspose.Imaging.ImageOptions.TiffOptions به درستی تنظیم شده است.
public bool IsValid { get; }
ارزش املاک
MaxSampleValue
حداکثر مقدار نمونه را دریافت یا تعیین کنید.
public ushort[] MaxSampleValue { get; set; }
ارزش املاک
ushort [ ]
Exceptions
ارزش
ارزش؛ طول محدوده باید با نمونه ها در هر پیکسل شمارش مطابقت داشته باشد.
MinSampleValue
دریافت یا تعیین مقدار نمونه مینی.
public ushort[] MinSampleValue { get; set; }
ارزش املاک
ushort [ ]
Exceptions
ارزش
ارزش؛ طول محدوده باید با نمونه ها در هر پیکسل شمارش مطابقت داشته باشد.
Orientation
جهت گیری یا جهت گیری را تعیین می کند.
public TiffOrientations Orientation { get; set; }
ارزش املاک
PageName
یا نام صفحه را وارد کنید.
public string PageName { get; set; }
ارزش املاک
PageNumber
دریافت و یا تنظیم صفحه شماره برچسب.
public ushort[] PageNumber { get; set; }
ارزش املاک
ushort [ ]
Exceptions
ارزش
ارزش؛ انتظار می رود 2 ارزش در ردیف: PageNumber[0] شماره صفحه است و PageNumber[1] تعداد کل صفحات در سند است.
Palette
قرار دادن یا قرار دادن پالت رنگی
public override IColorPalette Palette { get; set; }
ارزش املاک
Photometric
فتوامتر را دریافت یا تنظیم کنید.
public TiffPhotometrics Photometric { get; set; }
ارزش املاک
Examples
این مثال نشان می دهد که چگونه یک تصویر TIFF را از خراش ایجاد کنید و آن را به یک فایل ذخیره کنید.
string dir = "c:\\temp\\";
Aspose.Imaging.ImageOptions.TiffOptions createOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 8 bits for each color component.
createOptions.BitsPerSample = new ushort[] { 8, 8, 8 };
// Set the Big Endian byte order (Motorola)
createOptions.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.BigEndian;
// Set the LZW compression.
createOptions.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.Lzw;
// Set the RGB color model.
createOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
// All color components will be stored within a single plane.
createOptions.PlanarConfiguration = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPlanarConfigs.Contiguous;
// Create a TIFF Frame of 100x100 px.
// Note that you don't have to dispose a frame explicitly if it is included into TiffImage.
// When the container is disposed all frames will be disposed automatically.
Aspose.Imaging.FileFormats.Tiff.TiffFrame firstFrame = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(createOptions, 100, 100);
// Fill the entire frame with the blue-yellow gradient.
Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(firstFrame.Width, firstFrame.Height),
Aspose.Imaging.Color.Blue,
Aspose.Imaging.Color.Yellow);
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(firstFrame);
graphics.FillRectangle(gradientBrush, firstFrame.Bounds);
// Create a TIFF image.
using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = new Aspose.Imaging.FileFormats.Tiff.TiffImage(firstFrame))
{
tiffImage.Save(dir + "output.tif");
}
مثال زیر نشان می دهد که چگونه می توان یک TIFF مخلوط را از تصاویری راستر فردی تشکیل داد.
Aspose.Imaging.ImageOptions.TiffOptions createTiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
createTiffOptions.Source = new Aspose.Imaging.Sources.FileCreateSource("c:\\temp\\multipage.tif", false);
createTiffOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
createTiffOptions.BitsPerSample = new ushort[] { 8, 8, 8 };
using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Image.Create(createTiffOptions, 100, 100))
{
// This is Font and Brush for drawing text on individual frames.
Aspose.Imaging.Font font = new Aspose.Imaging.Font("Arial", 64);
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.White);
// Create 5 frames
for (int i = 1; i <= 5; i++)
{
Aspose.Imaging.ImageOptions.PngOptions createPngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
createPngOptions.Source = new Aspose.Imaging.Sources.StreamSource(new System.IO.MemoryStream());
// Create a PNG image and draw the number of page on it.
Aspose.Imaging.FileFormats.Png.PngImage pngImage = (Aspose.Imaging.FileFormats.Png.PngImage)Image.Create(createPngOptions, 100, 100);
Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(pngImage);
gr.DrawString(i.ToString(), font, brush, 10, 10);
// Create a frame based on the PNG image.
Aspose.Imaging.FileFormats.Tiff.TiffFrame frame = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(pngImage);
// Add the frame to the TIFF image.
tiffImage.AddFrame(frame);
}
// The image was created with a single default frame. Let's remove it.
Aspose.Imaging.FileFormats.Tiff.TiffFrame activeFrame = tiffImage.ActiveFrame;
tiffImage.ActiveFrame = tiffImage.Frames[1];
tiffImage.RemoveFrame(0);
// Don't forget to dispose the frame if you won't add it to some other TiffImage
activeFrame.Dispose();
tiffImage.Save();
}
مثال زیر نشان می دهد که چگونه یک کپی در مقیاس خاکستری از یک چارچوب موجود ایجاد کنید و آن را به یک تصویر TIFF اضافه کنید.
string dir = "c:\\temp\\";
Aspose.Imaging.ImageOptions.TiffOptions createTiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Create a permanent, not temporary file source.
createTiffOptions.Source = new Aspose.Imaging.Sources.FileCreateSource(dir + "multipage.tif", false);
createTiffOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
createTiffOptions.BitsPerSample = new ushort[] { 8, 8, 8 };
using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Image.Create(createTiffOptions, 100, 100))
{
// The linear gradient from the left-top to the right-bottom corner of the image.
Aspose.Imaging.Brushes.LinearGradientBrush brush =
new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(tiffImage.Width, tiffImage.Height),
Aspose.Imaging.Color.Red,
Aspose.Imaging.Color.Green);
// Fill the active frame with a linear gradient brush.
Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(tiffImage.ActiveFrame);
gr.FillRectangle(brush, tiffImage.Bounds);
// Grayscale options
Aspose.Imaging.ImageOptions.TiffOptions createTiffFrameOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
createTiffFrameOptions.Source = new Aspose.Imaging.Sources.StreamSource(new System.IO.MemoryStream());
createTiffFrameOptions.Photometric = Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.MinIsBlack;
createTiffFrameOptions.BitsPerSample = new ushort[] { 8 };
// Create a grayscale copy of the active frame.
// The pixel data is preserved but converted to the desired format.
Aspose.Imaging.FileFormats.Tiff.TiffFrame grayscaleFrame = Aspose.Imaging.FileFormats.Tiff.TiffFrame.CreateFrameFrom(tiffImage.ActiveFrame, createTiffFrameOptions);
// Add the newly created frame to the TIFF image.
tiffImage.AddFrame(grayscaleFrame);
tiffImage.Save();
}
این مثال نشان می دهد که چگونه یک تصویر راستر را در فرمت TIFF با استفاده از گزینه های مختلف ذخیره کنید.
string dir = "c:\\temp\\";
Aspose.Imaging.ImageOptions.TiffOptions saveOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 8 bits for each color component.
saveOptions.BitsPerSample = new ushort[] { 8, 8, 8 };
// Set the Big Endian byte order (Motorola)
saveOptions.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.BigEndian;
// Set the LZW compression.
saveOptions.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.Lzw;
// Allow to reduce the size of continuous-tone images.
// Currently this field is used only with LZW encoding because LZW is probably the only TIFF encoding scheme
// that benefits significantly from a predictor step.
saveOptions.Predictor = Imaging.FileFormats.Tiff.Enums.TiffPredictor.Horizontal;
// Set the RGB color model.
saveOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
// For YCbCr, you can use one of the following choices:
// YCbCrSubSampling field JPEG sampling factors
// ----------------------------------------------
// 1,1 1x1, 1x1, 1x1
// 2,1 2x1, 1x1, 1x1
// 2,2(default value) 2x2, 1x1, 1x1
// saveOptions.YCbCrSubsampling = new ushort[] { 2, 2 };
// All color components will be stored within a singel plane.
saveOptions.PlanarConfiguration = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPlanarConfigs.Contiguous;
// Create a TIFF Frame of 100x100 px.
using (Aspose.Imaging.Image image = new Aspose.Imaging.FileFormats.Bmp.BmpImage(100, 100))
{
// Fill the entire image with the blue-yellow gradient.
Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(image.Width, image.Height),
Aspose.Imaging.Color.Blue,
Aspose.Imaging.Color.Yellow);
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
graphics.FillRectangle(gradientBrush, image.Bounds);
image.Save(dir + "output.tif", saveOptions);
}
این مثال نشان می دهد که چگونه یک تصویر TIFF با 2 چارچوب ایجاد کنید و آن را به یک فایل ذخیره کنید.
string dir = "c:\\temp\\";
// Options for the first frame
Aspose.Imaging.ImageOptions.TiffOptions createOptions1 = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 8 bits for each color component.
createOptions1.BitsPerSample = new ushort[] { 8, 8, 8 };
// Set the Big Endian byte order (Motorola)
createOptions1.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.BigEndian;
// Set the LZW compression.
createOptions1.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.Lzw;
// Set the RGB color model.
createOptions1.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
// All color components will be stored within a single plane.
createOptions1.PlanarConfiguration = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPlanarConfigs.Contiguous;
// Create the first TIFF frame of 100x100 px.
// Note that you don't have to dispose frames explicitly if they are included into TiffImage.
// When the container is disposed all frames will be disposed automatically.
Aspose.Imaging.FileFormats.Tiff.TiffFrame frame1 = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(createOptions1, 100, 100);
// Fill the first frame with the blue-yellow gradient.
Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(frame1.Width, frame1.Height),
Aspose.Imaging.Color.Blue,
Aspose.Imaging.Color.Yellow);
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(frame1);
graphics.FillRectangle(gradientBrush, frame1.Bounds);
// Options for the first frame
Aspose.Imaging.ImageOptions.TiffOptions createOptions2 = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 1 bit per pixel for a B/W image.
createOptions2.BitsPerSample = new ushort[] { 1 };
// Set the Little Endian byte order (Intel)
createOptions2.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.LittleEndian;
// Set the CCITT Group 3 Fax compression.
createOptions2.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.CcittFax3;
// Set the B/W color model where 0 is black, 1 is white.
createOptions2.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.MinIsBlack;
// Create the second TIFF frame of 200x200px.
Aspose.Imaging.FileFormats.Tiff.TiffFrame frame2 = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(createOptions2, 200, 200);
// Fill the second frame with the blue-yellow gradient.
// It will be automatically converted to the B/W format due to the corresponding settings of the frame.
Aspose.Imaging.Graphics graphics2 = new Aspose.Imaging.Graphics(frame2);
graphics2.FillRectangle(gradientBrush, frame2.Bounds);
// Create a TIFF image.
using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = new Aspose.Imaging.FileFormats.Tiff.TiffImage(
new Aspose.Imaging.FileFormats.Tiff.TiffFrame[] { frame1, frame2 }))
{
tiffImage.Save(dir + "output.mutliframe.tif");
}
PlanarConfiguration
تنظیم یا تنظیم تنظیم برنامه
public TiffPlanarConfigs PlanarConfiguration { get; set; }
ارزش املاک
Examples
این مثال نشان می دهد که چگونه یک تصویر TIFF را از خراش ایجاد کنید و آن را به یک فایل ذخیره کنید.
string dir = "c:\\temp\\";
Aspose.Imaging.ImageOptions.TiffOptions createOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 8 bits for each color component.
createOptions.BitsPerSample = new ushort[] { 8, 8, 8 };
// Set the Big Endian byte order (Motorola)
createOptions.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.BigEndian;
// Set the LZW compression.
createOptions.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.Lzw;
// Set the RGB color model.
createOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
// All color components will be stored within a single plane.
createOptions.PlanarConfiguration = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPlanarConfigs.Contiguous;
// Create a TIFF Frame of 100x100 px.
// Note that you don't have to dispose a frame explicitly if it is included into TiffImage.
// When the container is disposed all frames will be disposed automatically.
Aspose.Imaging.FileFormats.Tiff.TiffFrame firstFrame = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(createOptions, 100, 100);
// Fill the entire frame with the blue-yellow gradient.
Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(firstFrame.Width, firstFrame.Height),
Aspose.Imaging.Color.Blue,
Aspose.Imaging.Color.Yellow);
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(firstFrame);
graphics.FillRectangle(gradientBrush, firstFrame.Bounds);
// Create a TIFF image.
using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = new Aspose.Imaging.FileFormats.Tiff.TiffImage(firstFrame))
{
tiffImage.Save(dir + "output.tif");
}
این مثال نشان می دهد که چگونه یک تصویر راستر را در فرمت TIFF با استفاده از گزینه های مختلف ذخیره کنید.
string dir = "c:\\temp\\";
Aspose.Imaging.ImageOptions.TiffOptions saveOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 8 bits for each color component.
saveOptions.BitsPerSample = new ushort[] { 8, 8, 8 };
// Set the Big Endian byte order (Motorola)
saveOptions.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.BigEndian;
// Set the LZW compression.
saveOptions.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.Lzw;
// Allow to reduce the size of continuous-tone images.
// Currently this field is used only with LZW encoding because LZW is probably the only TIFF encoding scheme
// that benefits significantly from a predictor step.
saveOptions.Predictor = Imaging.FileFormats.Tiff.Enums.TiffPredictor.Horizontal;
// Set the RGB color model.
saveOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
// For YCbCr, you can use one of the following choices:
// YCbCrSubSampling field JPEG sampling factors
// ----------------------------------------------
// 1,1 1x1, 1x1, 1x1
// 2,1 2x1, 1x1, 1x1
// 2,2(default value) 2x2, 1x1, 1x1
// saveOptions.YCbCrSubsampling = new ushort[] { 2, 2 };
// All color components will be stored within a singel plane.
saveOptions.PlanarConfiguration = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPlanarConfigs.Contiguous;
// Create a TIFF Frame of 100x100 px.
using (Aspose.Imaging.Image image = new Aspose.Imaging.FileFormats.Bmp.BmpImage(100, 100))
{
// Fill the entire image with the blue-yellow gradient.
Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(image.Width, image.Height),
Aspose.Imaging.Color.Blue,
Aspose.Imaging.Color.Yellow);
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
graphics.FillRectangle(gradientBrush, image.Bounds);
image.Save(dir + "output.tif", saveOptions);
}
این مثال نشان می دهد که چگونه یک تصویر TIFF با 2 چارچوب ایجاد کنید و آن را به یک فایل ذخیره کنید.
string dir = "c:\\temp\\";
// Options for the first frame
Aspose.Imaging.ImageOptions.TiffOptions createOptions1 = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 8 bits for each color component.
createOptions1.BitsPerSample = new ushort[] { 8, 8, 8 };
// Set the Big Endian byte order (Motorola)
createOptions1.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.BigEndian;
// Set the LZW compression.
createOptions1.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.Lzw;
// Set the RGB color model.
createOptions1.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
// All color components will be stored within a single plane.
createOptions1.PlanarConfiguration = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPlanarConfigs.Contiguous;
// Create the first TIFF frame of 100x100 px.
// Note that you don't have to dispose frames explicitly if they are included into TiffImage.
// When the container is disposed all frames will be disposed automatically.
Aspose.Imaging.FileFormats.Tiff.TiffFrame frame1 = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(createOptions1, 100, 100);
// Fill the first frame with the blue-yellow gradient.
Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(frame1.Width, frame1.Height),
Aspose.Imaging.Color.Blue,
Aspose.Imaging.Color.Yellow);
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(frame1);
graphics.FillRectangle(gradientBrush, frame1.Bounds);
// Options for the first frame
Aspose.Imaging.ImageOptions.TiffOptions createOptions2 = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 1 bit per pixel for a B/W image.
createOptions2.BitsPerSample = new ushort[] { 1 };
// Set the Little Endian byte order (Intel)
createOptions2.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.LittleEndian;
// Set the CCITT Group 3 Fax compression.
createOptions2.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.CcittFax3;
// Set the B/W color model where 0 is black, 1 is white.
createOptions2.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.MinIsBlack;
// Create the second TIFF frame of 200x200px.
Aspose.Imaging.FileFormats.Tiff.TiffFrame frame2 = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(createOptions2, 200, 200);
// Fill the second frame with the blue-yellow gradient.
// It will be automatically converted to the B/W format due to the corresponding settings of the frame.
Aspose.Imaging.Graphics graphics2 = new Aspose.Imaging.Graphics(frame2);
graphics2.FillRectangle(gradientBrush, frame2.Bounds);
// Create a TIFF image.
using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = new Aspose.Imaging.FileFormats.Tiff.TiffImage(
new Aspose.Imaging.FileFormats.Tiff.TiffFrame[] { frame1, frame2 }))
{
tiffImage.Save(dir + "output.mutliframe.tif");
}
Predictor
دریافت یا تنظیم پیش بینی کننده برای فشرده سازی LZW.
public TiffPredictor Predictor { get; set; }
ارزش املاک
Examples
این مثال نشان می دهد که چگونه یک تصویر راستر را در فرمت TIFF با استفاده از گزینه های مختلف ذخیره کنید.
string dir = "c:\\temp\\";
Aspose.Imaging.ImageOptions.TiffOptions saveOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 8 bits for each color component.
saveOptions.BitsPerSample = new ushort[] { 8, 8, 8 };
// Set the Big Endian byte order (Motorola)
saveOptions.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.BigEndian;
// Set the LZW compression.
saveOptions.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.Lzw;
// Allow to reduce the size of continuous-tone images.
// Currently this field is used only with LZW encoding because LZW is probably the only TIFF encoding scheme
// that benefits significantly from a predictor step.
saveOptions.Predictor = Imaging.FileFormats.Tiff.Enums.TiffPredictor.Horizontal;
// Set the RGB color model.
saveOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
// For YCbCr, you can use one of the following choices:
// YCbCrSubSampling field JPEG sampling factors
// ----------------------------------------------
// 1,1 1x1, 1x1, 1x1
// 2,1 2x1, 1x1, 1x1
// 2,2(default value) 2x2, 1x1, 1x1
// saveOptions.YCbCrSubsampling = new ushort[] { 2, 2 };
// All color components will be stored within a singel plane.
saveOptions.PlanarConfiguration = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPlanarConfigs.Contiguous;
// Create a TIFF Frame of 100x100 px.
using (Aspose.Imaging.Image image = new Aspose.Imaging.FileFormats.Bmp.BmpImage(100, 100))
{
// Fill the entire image with the blue-yellow gradient.
Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(image.Width, image.Height),
Aspose.Imaging.Color.Blue,
Aspose.Imaging.Color.Yellow);
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
graphics.FillRectangle(gradientBrush, image.Bounds);
image.Save(dir + "output.tif", saveOptions);
}
PremultiplyComponents
دریافت یا تنظیم یک مقدار نشان می دهد که آیا اجزای باید بیش از حد باشد.
[JsonProperty]
public bool PremultiplyComponents { get; set; }
ارزش املاک
ResolutionSettings
تنظیمات یا تنظیمات رزولوشن را دریافت کنید.
public override ResolutionSetting ResolutionSettings { get; set; }
ارزش املاک
ResolutionUnit
یک واحد رزولوشن را دریافت یا تنظیم کنید.
public TiffResolutionUnits ResolutionUnit { get; set; }
ارزش املاک
RowsPerStrip
به دست آوردن یا قرار دادن ردیف ها در هر نوار.
public uint RowsPerStrip { get; set; }
ارزش املاک
SampleFormat
فرم نمونه را دریافت یا تنظیم کنید.
public TiffSampleFormats[] SampleFormat { get; set; }
ارزش املاک
Exceptions
ارزش
ارزش؛ طول محدوده باید با نمونه ها در هر پیکسل شمارش مطابقت داشته باشد.
SamplesPerPixel
برای تغییر ارزش این دارایی از Aspose.Imaging.ImageOptions.TiffOptions.BitsPerSample استفاده کنید.
public ushort SamplesPerPixel { get; }
ارزش املاک
ScannerManufacturer
دریافت و یا تنظیم سازنده اسکنر.
public string ScannerManufacturer { get; set; }
ارزش املاک
ScannerModel
مدل اسکنر را دریافت یا تنظیم کنید.
public string ScannerModel { get; set; }
ارزش املاک
SmaxSampleValue
این مقدار دارای یک نوع میدان است که بهتر است با داده های نمونه (Byte، Short یا Long) مطابقت داشته باشد.
public uint[] SmaxSampleValue { get; set; }
ارزش املاک
uint [ ]
SminSampleValue
این مقدار دارای نوع میدان است که بهترین متناسب با داده های نمونه (بیت، کوتاه یا طولانی) است.
public uint[] SminSampleValue { get; set; }
ارزش املاک
uint [ ]
SoftwareType
دریافت یا تنظیم نوع نرم افزار.
public string SoftwareType { get; set; }
ارزش املاک
StripByteCounts
بایت یا بایت را محاسبه کنید.
public ulong[] StripByteCounts { get; set; }
ارزش املاک
ulong [ ]
StripOffsets
بفرستید و یا بفرستید و بفرستید.
public ulong[] StripOffsets { get; set; }
ارزش املاک
ulong [ ]
SubFileType
دریافت یا قرار دادن یک نشانه کلی از نوع داده های موجود در این فرمت.
public TiffNewSubFileTypes SubFileType { get; set; }
ارزش املاک
TagCount
برچسب ها را شمارش کنید
public int TagCount { get; }
ارزش املاک
Tags
بایگانی برچسب ها یا بایگانی برچسب ها
public TiffDataType[] Tags { get; set; }
ارزش املاک
TiffDataType [ ]
TargetPrinter
به چاپگر هدف می رسد یا هدف قرار می گیرد.
public string TargetPrinter { get; set; }
ارزش املاک
Threshholding
بفرستید یا بفرستید.
public TiffThresholds Threshholding { get; set; }
ارزش املاک
TileByteCounts
به حساب می آید یا به حساب می آید.
public ulong[] TileByteCounts { get; set; }
ارزش املاک
ulong [ ]
TileLength
در این حالت می توان به مدت طول می کشد.
public uint TileLength { get; set; }
ارزش املاک
TileOffsets
به دست آوردن و یا قرار دادن تایلند.
public ulong[] TileOffsets { get; set; }
ارزش املاک
ulong [ ]
TileWidth
به نظر می رسد که اوت پهنای باند را تنظیم می کند.
public uint TileWidth { get; set; }
ارزش املاک
TotalPages
صفحه های کل را دریافت کنید.
public ushort TotalPages { get; }
ارزش املاک
ValidTagCount
این تعداد کل برچسب ها نیست، بلکه تعداد برچسب هایی است که می توانند حفظ شوند.
public int ValidTagCount { get; }
ارزش املاک
نویسنده xpauthor
دریافت یا تنظیم نویسنده تصویر، که توسط ویندوز اکسپلورر استفاده می شود.
public string XPAuthor { get; set; }
ارزش املاک
XPتصویر
دریافت یا ارسال نظر در تصویر، که توسط ویندوز اکسپلورر استفاده می شود.
public string XPComment { get; set; }
ارزش املاک
XPKeywords
دریافت یا تنظیم تصویر موضوع، که توسط ویندوز اکسپلورر استفاده می شود.
public string XPKeywords { get; set; }
ارزش املاک
XPSubject
دریافت یا تنظیم اطلاعات مربوط به تصویر، که توسط ویندوز اکسپلورر استفاده می شود.
public string XPSubject { get; set; }
ارزش املاک
XPTitle
دریافت یا تنظیم اطلاعات مربوط به تصویر، که توسط ویندوز اکسپلورر استفاده می شود.
public string XPTitle { get; set; }
ارزش املاک
Xposition
موقعیت X را به دست می آورد یا تنظیم می کند.
public TiffRational Xposition { get; set; }
ارزش املاک
Xresolution
دریافت یا تنظیم رزولوشن x.
public TiffRational Xresolution { get; set; }
ارزش املاک
YCbCrاستفاده
دریافت یا تنظیم YCbCrCoefficients.
public TiffRational[] YCbCrCoefficients { get; set; }
ارزش املاک
TiffRational [ ]
Exceptions
محاسبه معادله معادله معادله معادله معادله معادله معادله معادله معادله معادله معادله معادله معادله معادله
ارزش
YCbCrمجموعه
دریافت یا تنظیم فاکتورهای زیرمجموعه برای YCbCr photometric.
public ushort[] YCbCrSubsampling { get; set; }
ارزش املاک
ushort [ ]
Examples
این مثال نشان می دهد که چگونه یک تصویر راستر را در فرمت TIFF با استفاده از گزینه های مختلف ذخیره کنید.
string dir = "c:\\temp\\";
Aspose.Imaging.ImageOptions.TiffOptions saveOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 8 bits for each color component.
saveOptions.BitsPerSample = new ushort[] { 8, 8, 8 };
// Set the Big Endian byte order (Motorola)
saveOptions.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.BigEndian;
// Set the LZW compression.
saveOptions.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.Lzw;
// Allow to reduce the size of continuous-tone images.
// Currently this field is used only with LZW encoding because LZW is probably the only TIFF encoding scheme
// that benefits significantly from a predictor step.
saveOptions.Predictor = Imaging.FileFormats.Tiff.Enums.TiffPredictor.Horizontal;
// Set the RGB color model.
saveOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
// For YCbCr, you can use one of the following choices:
// YCbCrSubSampling field JPEG sampling factors
// ----------------------------------------------
// 1,1 1x1, 1x1, 1x1
// 2,1 2x1, 1x1, 1x1
// 2,2(default value) 2x2, 1x1, 1x1
// saveOptions.YCbCrSubsampling = new ushort[] { 2, 2 };
// All color components will be stored within a singel plane.
saveOptions.PlanarConfiguration = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPlanarConfigs.Contiguous;
// Create a TIFF Frame of 100x100 px.
using (Aspose.Imaging.Image image = new Aspose.Imaging.FileFormats.Bmp.BmpImage(100, 100))
{
// Fill the entire image with the blue-yellow gradient.
Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(image.Width, image.Height),
Aspose.Imaging.Color.Blue,
Aspose.Imaging.Color.Yellow);
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
graphics.FillRectangle(gradientBrush, image.Bounds);
image.Save(dir + "output.tif", saveOptions);
}
Exceptions
طول میدان نادرست: میدان YCbCrSubsampling باید شامل دو مقدار باشد.
ارزش
Yposition
موقعیت یا موقعیت را تعیین می کند.
public TiffRational Yposition { get; set; }
ارزش املاک
Yresolution
تصمیم گیری یا تصمیم گیری را بر عهده دارد.
public TiffRational Yresolution { get; set; }
ارزش املاک
Methods
AddTag(TiffDataType)
یک برچسب جدید اضافه کنید.
public void AddTag(TiffDataType tagToAdd)
Parameters
tagToAdd
TiffDataType
برچسب برای اضافه کردن
AddTags(TiffDataType[])
برچسب ها را اضافه کنید
public void AddTags(TiffDataType[] tagsToAdd)
Parameters
tagsToAdd
TiffDataType
[ ]
بایگانی برچسب ها اضافه کنید
Clone()
این حالت را کلون کنید.
public override ImageOptionsBase Clone()
Returns
یک کلون عمیق برمی گردد.
GetTagByType(TiffTags)
به عنوان مثال از نوع به نوع استفاده می شود.
public TiffDataType GetTagByType(TiffTags tagKey)
Parameters
tagKey
TiffTags
برچسب کلید
Returns
در صورت وجود یا در غیر این صورت وجود ندارد.
GetValidTagsCount(TiffDataType[])
برچسب های معتبر را شمارش کنید.
public static int GetValidTagsCount(TiffDataType[] tags)
Parameters
tags
TiffDataType
[ ]
برچسب ها برای تأیید
Returns
برچسب های معتبر را شمارش کنید.
IsTagPresent(TiffTags)
تعیین می کند که آیا برچسب در گزینه ها وجود دارد یا نه.
public bool IsTagPresent(TiffTags tag)
Parameters
tag
TiffTags
برچسب ID برای چک کردن
Returns
“واقعی” اگر برچسب وجود داشته باشد؛ در غیر این صورت، “دروغ” است.
RemoveTag(TiffTags)
برچسب را حذف کنید.
public bool RemoveTag(TiffTags tag)
Parameters
tag
TiffTags
برچسب برای حذف
Returns
اگر با موفقیت حذف شود
RemoveTags(برچسب ها TiffTags[])
برچسب ها را حذف کنید.
public bool RemoveTags(params TiffTags[] tags)
Parameters
tags
TiffTags
[ ]
برچسب ها برای حذف
Returns
درست در صورت تغییر حجم جمع آوری
Validate()
تأیید می کند که آیا گزینه ها ترکیبی معتبر از برچسب ها دارند
public void Validate()