Class TiffOptions

Class TiffOptions

اسم الفضاء : Aspose.Imaging.ImageOptions تجميع: Aspose.Imaging.dll (25.4.0)

خيارات تنسيق ملف tiff.يرجى ملاحظة أن علامات العرض والارتفاع سوف تكون مبالغ فيها على إنشاء الصورة بواسطة المعلمات العرض والارتفاع لذلك لا حاجة لتحديدها مباشرة.يرجى ملاحظة أن العديد من الخيارات تعيد قيمة افتراضية ولكن هذا لا يعني أن هذا الخيار يتم تعيينها صراحة كقيمة علامة.

[JsonObject(MemberSerialization.OptIn)]
public class TiffOptions : ImageOptionsBase, IDisposable, ICloneable, IHasExifData, IHasXmpData, IHasMetadata

Inheritance

object DisposableObject ImageOptionsBase TiffOptions

Derived

BigTiffOptions

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(TiffExpectedFormat، 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; }

قيمة الممتلكات

TiffAlphaStorage

Artist

يحصل على أو يضع الفنان.

public string Artist { get; set; }

قيمة الممتلكات

string

BitsPerPixel

يحصل على البطاقات لكل بكسل.

public int BitsPerPixel { get; }

قيمة الممتلكات

int

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

قيمة الممتلكات

TiffByteOrder

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

ArgumentNullException

القيمة

TiffImageException

يمكن تعريف خريطة الألوان للعينات لكل بكسل تساوي 1 فقط.أولا يتم تحديد النقاط لكل عينة.

ArgumentOutOfRangeException

قيمة؛يجب أن يتوافق طول الشريط مع الصيغة التالية: 3 * (2**BitsPerSample).

CompressedQuality

يحصل أو يضع جودة الصورة المضغوطة.يستخدم مع ضغط Jpeg.

public int CompressedQuality { get; set; }

قيمة الممتلكات

int

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

قيمة الممتلكات

TiffCompressions

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

قيمة الممتلكات

string

DateTime

يحصل أو يحدد التاريخ والوقت.

public string DateTime { get; set; }

قيمة الممتلكات

string

DefaultMemoryAllocationLimit

يحصل أو يحدد الحد الافتراضي لتخصيص الذاكرة.

[Obsolete("Use Aspose.Imaging.Image.BufferSizeHint, Aspose.Imaging.ImageOptionsBase.BufferSizeHint or Aspose.Imaging.LoadOptions.BufferSizeHint instead.")]
public int DefaultMemoryAllocationLimit { get; set; }

قيمة الممتلكات

int

DisableIccExport

يحصل أو يضع قيمة تشير إلى ما إذا كان تصدير ملف تعريف ICC محظورًا (يتم تطبيق ملف تعريف ICC على بكسل المصدر مسبقًا).

[JsonProperty]
public bool DisableIccExport { get; set; }

قيمة الممتلكات

bool

DocumentName

يحصل أو يضع اسم الوثيقة.

public string DocumentName { get; set; }

قيمة الممتلكات

string

ExifData

الحصول على أو إعداد بيانات Exif.

public ExifData ExifData { get; set; }

قيمة الممتلكات

ExifData

ExifIfd

يحصل أو يضع المؤشر على EXIF IFD.

public TiffExifIfd ExifIfd { get; }

قيمة الممتلكات

TiffExifIfd

ExtraSamples

يحصل على قيمة العينات الإضافية.

public ushort[] ExtraSamples { get; }

قيمة الممتلكات

ushort [ ]

FaxT4Options

يحصل أو يضع الخيارات الفاكس t4.

public Group3Options FaxT4Options { get; set; }

قيمة الممتلكات

Group3Options

FileStandard

يحصل أو يضع معايير ملف TIFF.

public TiffFileStandards FileStandard { get; set; }

قيمة الممتلكات

TiffFileStandards

FillOrder

يحصل أو يضع بايت بيتات ملء الأوامر.

public TiffFillOrders FillOrder { get; set; }

قيمة الممتلكات

TiffFillOrders

HalfToneHints

يحصل أو يضع النقاط النصفية.

public ushort[] HalfToneHints { get; set; }

قيمة الممتلكات

ushort [ ]

Exceptions

ArgumentNullException

القيمة

ArgumentOutOfRangeException

القيمة؛ يجب أن يكون طول شريط علامات Halftone يساوي 2.

IccProfile

يحصل أو يضع تدفق الملف الشخصي Icc.

public MemoryStream IccProfile { get; set; }

قيمة الممتلكات

MemoryStream

ImageDescription

يحصل أو يضع وصف الصورة.

public string ImageDescription { get; set; }

قيمة الممتلكات

string

ImageLength

يحصل أو يحدد طول الصورة.

public uint ImageLength { get; set; }

قيمة الممتلكات

uint

ImageWidth

يحصل أو يضع عرض الصورة.

public uint ImageWidth { get; set; }

قيمة الممتلكات

uint

InkNames

يحصل أو يضع أسماء الإبرة.

public string InkNames { get; set; }

قيمة الممتلكات

string

IsExtraSamplesPresent

يحصل على قيمة تشير إلى ما إذا كانت العينات الإضافية موجودة.

public bool IsExtraSamplesPresent { get; }

قيمة الممتلكات

bool

IsTiled

يحصل على قيمة تشير إلى ما إذا كانت الصورة مدمجة.

public bool IsTiled { get; }

قيمة الممتلكات

bool

IsValid

يحصل على قيمة تشير إلى ما إذا كانت Aspose.Imaging.ImageOptions.TiffOptions قد تم تكوينها بشكل صحيح.

public bool IsValid { get; }

قيمة الممتلكات

bool

MaxSampleValue

يحصل أو يضع قيمة عينة ماكس.

public ushort[] MaxSampleValue { get; set; }

قيمة الممتلكات

ushort [ ]

Exceptions

ArgumentNullException

القيمة

ArgumentOutOfRangeException

قيمة؛يجب أن يتوافق طول الشريط مع العينات لكل عدد بكسل.

MinSampleValue

يحصل أو يضع قيمة العينة الصغيرة.

public ushort[] MinSampleValue { get; set; }

قيمة الممتلكات

ushort [ ]

Exceptions

ArgumentNullException

القيمة

ArgumentOutOfRangeException

قيمة؛يجب أن يتوافق طول الشريط مع العينات لكل عدد بكسل.

Orientation

تحصل على أو وضع التوجه.

public TiffOrientations Orientation { get; set; }

قيمة الممتلكات

TiffOrientations

PageName

يحصل أو يضع اسم الصفحة.

public string PageName { get; set; }

قيمة الممتلكات

string

PageNumber

يحصل أو يضع علامة رقم الصفحة.

public ushort[] PageNumber { get; set; }

قيمة الممتلكات

ushort [ ]

Exceptions

ArgumentNullException

القيمة

ArgumentOutOfRangeException

قيمة؛توقع 2 قيم في السلسلة: PageNumber[0] هو رقم الصفحة و PageNumber[1] هو العدد الإجمالي للصفحات في المستند.

Palette

يحصل أو يضع لوحة الألوان.

public override IColorPalette Palette { get; set; }

قيمة الممتلكات

IColorPalette

Photometric

تحصل على أو وضع الضوء.

public TiffPhotometrics Photometric { get; set; }

قيمة الممتلكات

TiffPhotometrics

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

قيمة الممتلكات

TiffPlanarConfigs

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

قيمة الممتلكات

TiffPredictor

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

قيمة الممتلكات

bool

ResolutionSettings

يحصل أو يضع إعدادات القرار.

public override ResolutionSetting ResolutionSettings { get; set; }

قيمة الممتلكات

ResolutionSetting

ResolutionUnit

يحصل أو يضع وحدة القرار.

public TiffResolutionUnits ResolutionUnit { get; set; }

قيمة الممتلكات

TiffResolutionUnits

RowsPerStrip

يحصل أو يضع الصفوف على شريط.

public uint RowsPerStrip { get; set; }

قيمة الممتلكات

uint

SampleFormat

يحصل أو يضع تنسيق العينة.

public TiffSampleFormats[] SampleFormat { get; set; }

قيمة الممتلكات

TiffSampleFormats [ ]

Exceptions

ArgumentNullException

القيمة

ArgumentOutOfRangeException

قيمة؛يجب أن يتوافق طول الشريط مع العينات لكل عدد بكسل.

SamplesPerPixel

للحصول على العينات لكل بكسل. لتغيير هذه القيمة الممتلكات باستخدام Aspose.Imaging.ImageOptions.TiffOptions.BitsPerSample الممتلكات setter.

public ushort SamplesPerPixel { get; }

قيمة الممتلكات

ushort

ScannerManufacturer

يحصل أو يضع المصنع الماسح الضوئي.

public string ScannerManufacturer { get; set; }

قيمة الممتلكات

string

ScannerModel

يحصل أو يضع نموذج المسح الضوئي.

public string ScannerModel { get; set; }

قيمة الممتلكات

string

SmaxSampleValue

يحصل أو يضع قيمة العينة القصوى.القيمة لديها نوع الحقل الذي يتطابق بشكل أفضل مع بيانات العينة (النوع الكبير أو القصير أو الطويل).

public uint[] SmaxSampleValue { get; set; }

قيمة الممتلكات

uint [ ]

SminSampleValue

يحصل أو يضع قيمة العينة الصغيرة.القيمة لديها نوع الحقل الذي يتطابق بشكل أفضل مع بيانات العينة (نوع بيت أو قصير أو طويل).

public uint[] SminSampleValue { get; set; }

قيمة الممتلكات

uint [ ]

SoftwareType

يحصل أو يضع نوع البرمجيات.

public string SoftwareType { get; set; }

قيمة الممتلكات

string

StripByteCounts

يحصل أو يضع شريط بايت حسابات.

public ulong[] StripByteCounts { get; set; }

قيمة الممتلكات

ulong [ ]

StripOffsets

يأخذ أو يضع الشريط الخلفي.

public ulong[] StripOffsets { get; set; }

قيمة الممتلكات

ulong [ ]

SubFileType

يحصل أو يضع إشارة عامة إلى نوع البيانات الموجودة في هذا الملف الفرعي.

public TiffNewSubFileTypes SubFileType { get; set; }

قيمة الممتلكات

TiffNewSubFileTypes

TagCount

احصل على عدد العلامات.

public int TagCount { get; }

قيمة الممتلكات

int

Tags

احصل على أو وضع علامات.

public TiffDataType[] Tags { get; set; }

قيمة الممتلكات

TiffDataType [ ]

TargetPrinter

يحصل أو يضع الطابعة المستهدفة.

public string TargetPrinter { get; set; }

قيمة الممتلكات

string

Threshholding

إما أن يحصل أو يضع الحصى.

public TiffThresholds Threshholding { get; set; }

قيمة الممتلكات

TiffThresholds

TileByteCounts

يحصل أو يضع عدد بايت التيت.

public ulong[] TileByteCounts { get; set; }

قيمة الممتلكات

ulong [ ]

TileLength

يحدد أطول طوله.

public uint TileLength { get; set; }

قيمة الممتلكات

uint

TileOffsets

يأخذ أو يضع الأقواس الخلفية.

public ulong[] TileOffsets { get; set; }

قيمة الممتلكات

ulong [ ]

TileWidth

يضع أوت عرض النطاق.

public uint TileWidth { get; set; }

قيمة الممتلكات

uint

TotalPages

يحصل على جميع الصفحات.

public ushort TotalPages { get; }

قيمة الممتلكات

ushort

ValidTagCount

هذا ليس إجمالي عدد العلامات ولكن عدد العلامات التي يمكن الحفاظ عليها.

public int ValidTagCount { get; }

قيمة الممتلكات

int

الكاتب XPA

يحصل أو يضع مؤلف الصورة، والتي تستخدمها ويندوز إكسبلورر.

public string XPAuthor { get; set; }

قيمة الممتلكات

string

XPمراجعة

يحصل أو يضع تعليقًا على الصورة ، والتي تستخدمها Windows Explorer.

public string XPComment { get; set; }

قيمة الممتلكات

string

كلمات XPKeywords

يحصل أو يضع صورة موضوعية تستخدمها ويندوز إكسبلورر.

public string XPKeywords { get; set; }

قيمة الممتلكات

string

XPSUBJECT

يحصل أو يضع معلومات عن الصورة، والتي تستخدمها ويندوز إكسبلورر.

public string XPSubject { get; set; }

قيمة الممتلكات

string

إكسيتيل

يحصل أو يضع معلومات عن الصورة، والتي تستخدمها ويندوز إكسبلورر.

public string XPTitle { get; set; }

قيمة الممتلكات

string

Xposition

يحصل أو يضع موقع x.

public TiffRational Xposition { get; set; }

قيمة الممتلكات

TiffRational

Xresolution

يحصل أو يضع X القرار.

public TiffRational Xresolution { get; set; }

قيمة الممتلكات

TiffRational

YCbCrمؤشرات

يحصل أو يضع مؤشرات YCbCr.

public TiffRational[] YCbCrCoefficients { get; set; }

قيمة الممتلكات

TiffRational [ ]

Exceptions

TiffImageException

عدد غير صالح من القيم المعادلة العقلانية.يجب أن يكون متساويا مع 3.

ArgumentNullException

القيمة

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

TiffImageException

يجب أن يحتوي حقل YCbCrSubsampling على قيم اثنين.

ArgumentNullException

القيمة

Yposition

يحصل أو يضع موقف Y.

public TiffRational Yposition { get; set; }

قيمة الممتلكات

TiffRational

Yresolution

يحصل على أو يضع القرار.

public TiffRational Yresolution { get; set; }

قيمة الممتلكات

TiffRational

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

ImageOptionsBase

وعودة الكلون العميق

GetTagByType(TiffTags)

يحصل على نموذج العلامة حسب النوع.

public TiffDataType GetTagByType(TiffTags tagKey)

Parameters

tagKey TiffTags

المفتاح العلامة

Returns

TiffDataType

إدخال العلامة إذا كانت موجودة أو صفر خلاف ذلك.

GetValidTagsCount(TiffDataType[])

احصل على عدد العلامات الصحيحة.

public static int GetValidTagsCount(TiffDataType[] tags)

Parameters

tags TiffDataType [ ]

العلامات التي يجب التحقق منها.

Returns

int

عدد العلامات الصحيحة.

IsTagPresent(TiffTags)

يحدد ما إذا كانت العلامة موجودة في الخيارات أم لا.

public bool IsTagPresent(TiffTags tag)

Parameters

tag TiffTags

علامة ID للتحقق.

Returns

bool

“الحقيقة” إذا كانت العلامة موجودة؛ وإلا، “مزيفة”.

RemoveTag(TiffTags)

إزالة العلامة

public bool RemoveTag(TiffTags tag)

Parameters

tag TiffTags

علامة التبويب لإزالة

Returns

bool

صحيح إذا تم إزالتها بنجاح

RemoveTags(أضواء TiffTags[])

إزالة العلامات

public bool RemoveTags(params TiffTags[] tags)

Parameters

tags TiffTags [ ]

العلامات لإزالتها.

Returns

bool

الحقيقة إذا تغير حجم جمع العلامة.

Validate()

تصديق ما إذا كانت الخيارات لديها مزيج صالح من العلامات

public void Validate()
 عربي