Class TiffOptions

Class TiffOptions

Названий на: Aspose.Imaging.ImageOptions Асамблея: Aspose.Imaging.dll (25.4.0)

Формат файлу тифф варіанти.Зверніть увагу, що ширина і висота теги будуть переписуватися на створення зображення за шириною і висотою параметрів, так що немає необхідності вказати їх безпосередньо.Зверніть увагу, що багато варіантів повертають стандартну вартість, але це не означає, що ця опція чітко визначається як вартість тегу.

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

Inheritance

object DisposableObject ImageOptionsBase TiffOptions

Derived

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 завантажується в інстанцію Image і потім експортується до декількох форматів.

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 і Графіки, щоб створити і маніпулювати Фігурами на зображенні поверхні. Приклад створює нову Зображення (типу Tiff), очищає поверхню і витягує шляхи за допомогою класу Grafics Path.

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

Ініціалізація нової інстанції класу Aspose.Imaging.ImageOptions.TiffOption.

public TiffOptions(TiffExpectedFormat expectedFormat, TiffByteOrder byteOrder)

Parameters

expectedFormat TiffExpectedFormat

Очікуваний формат файлу тиф.

byteOrder TiffByteOrder

Файл тиф формат байт замовлення для використання.

TiffOptions(TiffExpectedFormat)

Ініціалізує нову інстанцію класу Aspose.Imaging.ImageOptions.TiffOption. За замовчуванням використовується невелика конвенція.

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.TiffOption.

public TiffOptions(TiffOptions options)

Parameters

options TiffOptions

Вибір варіантів копіювання.

TiffOptions(TiffDataType[])

Ініціалізація нової інстанції класу Aspose.Imaging.ImageOptions.TiffOption.

public TiffOptions(TiffDataType[] tags)

Parameters

tags TiffDataType [ ]

Теги для ініціалізації варіантів з.

Properties

AlphaStorage

Отримати або встановити альфа-зберігання. варіанти, крім Aspose.Imaging.FileFormats.Tiff.Enums. TiffAlphaStorage.UnspecifiedВикористовуються, коли є більше 3 Aspose.Imaging.ImageOptions.TiffOption.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

При налаштуванні цієї вартості пам’ятайте, що вона також налаштує вартість SamplesPerPixel для налаштування довжини. ці 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

Приймає або встановлює значення, яке вказує на те, чи вимкнений експорт профілю МКС (профіль МККС застосовується до джерельних пікселів заздалегідь).

[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

вартість;Дв’ятиколірні показники довжини смуги повинні бути рівними до 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.TiffOption. Використовуйте метод Validate, щоб знайти причину невдачі.

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.TiffOption.BitsPerSample property setter.

public ushort SamplesPerPixel { get; }

вартість нерухомості

ushort

ScannerManufacturer

Використовується або встановлюється виробник сканера.

public string ScannerManufacturer { get; set; }

вартість нерухомості

string

ScannerModel

Приймати або встановити модель сканера.

public string ScannerModel { get; set; }

вартість нерухомості

string

SmaxSampleValue

Значення має тип поля, який найкраще відповідає даним зразка (Byte, Short або Long тип).

public uint[] SmaxSampleValue { get; set; }

вартість нерухомості

uint [ ]

SminSampleValue

Значення має тип поля, який найкраще відповідає даним зразка (Byte, Short або Long тип).

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

КСНУМКС

Знайти або встановити автор зображення, який використовується Windows Explorer.

public string XPAuthor { get; set; }

вартість нерухомості

string

XPкомпанія

Отримати або встановити коментар на зображення, яке використовується Windows Explorer.

public string XPComment { get; set; }

вартість нерухомості

string

XPKeywords

Знайти або встановити суб’єкт зображення, яке використовується Windows Explorer.

public string XPKeywords { get; set; }

вартість нерухомості

string

КСНУМКС

отримує або встановлює інформацію про зображення, яке використовується Windows Explorer.

public string XPSubject { get; set; }

вартість нерухомості

string

КСНУМКС

отримує або встановлює інформацію про зображення, яке використовується Windows Explorer.

public string XPTitle { get; set; }

вартість нерухомості

string

Xposition

Знайдіть або встановити позицію x.

public TiffRational Xposition { get; set; }

вартість нерухомості

TiffRational

Xresolution

Приймає або встановлює резолюцію x.

public TiffRational Xresolution { get; set; }

вартість нерухомості

TiffRational

YCbCrCoефіцити

Приймає або встановлює YCbCrCoefficients.

public TiffRational[] YCbCrCoefficients { get; set; }

вартість нерухомості

TiffRational [ ]

Exceptions

TiffImageException

Недійсний розрахунок раціональних коефіцієнтних значень. має бути рівним 3.

ArgumentNullException

цінності

YCbCrSubsampling

Використовується або встановлюється субзабірний фактор для фотометричного YCbCr.

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

Довжина поля Invalid. 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(Пам’ятки Тифф[])

Зніміть теги.

public bool RemoveTags(params TiffTags[] tags)

Parameters

tags TiffTags [ ]

Теги для видалення.

Returns

bool

правда Якщо змінюється розмір колекції.

Validate()

Визначити, чи є у варіантів діюча комбінація знаків

public void Validate()
 Українська