Class TiffOptions

Class TiffOptions

Nama dari : Aspose.Imaging.ImageOptions Pengumpulan: Aspose.Imaging.dll (25.4.0)

Pilihan format file tiff.Perhatikan bahwa tag lebar dan ketinggian akan tertulis pada penciptaan gambar oleh parameter lebar dan ketinggian sehingga tidak perlu menentukan secara langsung.Perhatikan bahwa banyak opsi mengembalikan nilai default tetapi ini tidak berarti bahwa opsi ini ditetapkan secara eksplisit sebagai nilai tag. Untuk mengkonfirmasi tag hadir menggunakan Properti Tag atau metode IsTagPresent yang sesuai.

[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

anggota yang diwarisi

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

Contoh ini menunjukkan penggunaan kelas yang berbeda dari SaveOptions Namespace untuk tujuan ekspor. gambar tipe Gif dimuat naik ke contoh Gambar dan kemudian diekspor ke beberapa format.

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

Contoh berikut menunjukkan bagaimana untuk menukar gambar vektor multipage ke format TIFF secara umum tanpa merujuk pada jenis gambar tertentu.

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

Contoh-contoh ini menggunakan GraphicsPath dan Graphics class untuk membuat dan memanipulasi Figur di permukaan Gambar. Contoh ini menciptakan Gambar baru (tiff), membersihkan permukaan dan menarik jalur dengan bantuan GraphicsPath class. Pada akhirnya metode DrawPath yang didedikasikan oleh Graphics class dipanggil untuk membuat jalur di permukaan.

//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(Teka-teki dari TiffByteOrder)

Initifikasi contoh baru dari kelas Aspose.Imaging.ImageOptions.TiffOptions.

public TiffOptions(TiffExpectedFormat expectedFormat, TiffByteOrder byteOrder)

Parameters

expectedFormat TiffExpectedFormat

Format file tiff yang diharapkan.

byteOrder TiffByteOrder

File tiff format byte perintah untuk digunakan.

TiffOptions(TiffExpectedFormat)

Inicialisasi contoh baru dari Aspose.Imaging.ImageOptions.TiffOptions kelas.

public TiffOptions(TiffExpectedFormat expectedFormat)

Parameters

expectedFormat TiffExpectedFormat

Format file tiff yang diharapkan.

Examples

Contoh berikut menunjukkan cara membuat salinan grafis dari bingkai yang ada dan menambahkan ke gambar 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();
                                                                                                                      }

Contoh ini menunjukkan cara menyimpan gambar raster ke format TIFF menggunakan berbagai opsi.

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)

Initifikasi contoh baru dari kelas Aspose.Imaging.ImageOptions.TiffOptions.

public TiffOptions(TiffOptions options)

Parameters

options TiffOptions

Pilihan untuk menyalin dari.

TiffOptions(TiffDataType[])

Initifikasi contoh baru dari kelas Aspose.Imaging.ImageOptions.TiffOptions.

public TiffOptions(TiffDataType[] tags)

Parameters

tags TiffDataType [ ]

Tabel untuk memulai pilihan dengan.

Properties

AlphaStorage

Dapatkan atau menetapkan opsi penyimpanan alfa. opsi selain Aspose.Imaging.FileFormats.Tiff.Enums.TiffAlphaStorage.Unspesifikasidigunakan ketika ada lebih dari 3 Aspose.Imaging.ImageOptions.TiffOptions.SamplesPerPixel ditakrifkan.

public TiffAlphaStorage AlphaStorage { get; set; }

Nilai Properti

TiffAlphaStorage

Artist

Mendapatkan atau menetapkan artis.

public string Artist { get; set; }

Nilai Properti

string

BitsPerPixel

Dapatkan bit per pixel.

public int BitsPerPixel { get; }

Nilai Properti

int

BitsPerSample

Dapatkan atau menetapkan bit per sampel.

public ushort[] BitsPerSample { get; set; }

Nilai Properti

ushort [ ]

Examples

Contoh ini menunjukkan cara membuat gambar TIFF dari scratch dan menyimpannya ke file.

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

Contoh berikut menunjukkan bagaimana untuk menyusun TIFF mutlipage dari gambar raster individu.

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

Contoh berikut menunjukkan cara membuat salinan grafis dari bingkai yang ada dan menambahkan ke gambar 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();
                                                                                                                      }

Contoh ini menunjukkan cara menyimpan gambar raster ke format TIFF menggunakan berbagai opsi.

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

Contoh ini menunjukkan cara membuat gambar TIFF dengan 2 bingkai dan menyimpannya ke file.

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

Ketika menetapkan nilai ini ingat bahwa itu juga akan menetapkan nilai SamplesPerPixel untuk mengatur panjang. 2 sifat ini sangat ketat berpasangan sehingga hanya dapat ditetapkan total.

ByteOrder

Dapatkan atau menetapkan nilai yang menunjukkan perintah tiff byte.

public TiffByteOrder ByteOrder { get; set; }

Nilai Properti

TiffByteOrder

Examples

Contoh ini menunjukkan cara membuat gambar TIFF dari scratch dan menyimpannya ke file.

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

Contoh ini menunjukkan cara menyimpan gambar raster ke format TIFF menggunakan berbagai opsi.

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

Contoh ini menunjukkan cara membuat gambar TIFF dengan 2 bingkai dan menyimpannya ke file.

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

Dapatkan atau menetapkan peta warna.

public ushort[] ColorMap { get; set; }

Nilai Properti

ushort [ ]

Exceptions

ArgumentNullException

Nilai

TiffImageException

Peta warna dapat ditentukan untuk sampel per piksel sama dengan 1 saja.atauBits per sampel tidak ditentukan.

ArgumentOutOfRangeException

nilai;Jangka panjang array harus sesuai dengan formula followign: 3 * (2**BitsPerSample).

CompressedQuality

Dapatkan atau menetapkan kualitas gambar yang dikompresi.Digunakan dengan kompresi JPEG.

public int CompressedQuality { get; set; }

Nilai Properti

int

Examples

Contoh ini menunjukkan cara membuat gambar TIFF dengan kompresi Jpeg dan kualitas gambar yang dikompresi.

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

Mendapatkan atau menetapkan kompresi.

public TiffCompressions Compression { get; set; }

Nilai Properti

TiffCompressions

Examples

Contoh ini menunjukkan cara membuat gambar TIFF dari scratch dan menyimpannya ke file.

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

Contoh ini menunjukkan cara menyimpan gambar raster ke format TIFF menggunakan berbagai opsi.

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

Contoh ini menunjukkan cara membuat gambar TIFF dengan 2 bingkai dan menyimpannya ke file.

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

Dapatkan atau menetapkan hak cipta.

public string Copyright { get; set; }

Nilai Properti

string

DateTime

Dapatkan atau menetapkan tanggal dan waktu.

public string DateTime { get; set; }

Nilai Properti

string

DefaultMemoryAllocationLimit

Dapatkan atau menetapkan batas pengagihan memori default.

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

Nilai Properti

int

DisableIccExport

Dapatkan atau menetapkan nilai yang menunjukkan apakah ekspor profil ICC dibatalkan (profil ICC diterapkan pada pixel sumber terlebih dahulu).

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

Nilai Properti

bool

DocumentName

Dapatkan atau menetapkan nama dokumen.

public string DocumentName { get; set; }

Nilai Properti

string

ExifData

Dapatkan atau menetapkan data Exif.

public ExifData ExifData { get; set; }

Nilai Properti

ExifData

ExifIfd

Mendapatkan atau menetapkan penunjuk ke EXIF IFD.

public TiffExifIfd ExifIfd { get; }

Nilai Properti

TiffExifIfd

ExtraSamples

Dapatkan nilai sampel tambahan.

public ushort[] ExtraSamples { get; }

Nilai Properti

ushort [ ]

FaxT4Options

Dapatkan atau menetapkan faks t4 opsi.

public Group3Options FaxT4Options { get; set; }

Nilai Properti

Group3Options

FileStandard

Dapatkan atau menetapkan standar file TIFF.

public TiffFileStandards FileStandard { get; set; }

Nilai Properti

TiffFileStandards

FillOrder

Dapatkan atau menetapkan byte bit mengisi pesanan.

public TiffFillOrders FillOrder { get; set; }

Nilai Properti

TiffFillOrders

HalfToneHints

Mendapatkan atau menetapkan petunjuk setengah.

public ushort[] HalfToneHints { get; set; }

Nilai Properti

ushort [ ]

Exceptions

ArgumentNullException

Nilai

ArgumentOutOfRangeException

Nilai;Halftone petunjuk panjang array harus sama dengan 2.

IccProfile

Dapatkan atau menetapkan aliran profil Icc.

public MemoryStream IccProfile { get; set; }

Nilai Properti

MemoryStream

ImageDescription

Dapatkan atau menetapkan deskripsi gambar.

public string ImageDescription { get; set; }

Nilai Properti

string

ImageLength

Dapatkan atau menetapkan panjang gambar.

public uint ImageLength { get; set; }

Nilai Properti

uint

ImageWidth

Dapatkan atau menetapkan lebar gambar.

public uint ImageWidth { get; set; }

Nilai Properti

uint

InkNames

Dapatkan atau menetapkan nama ink.

public string InkNames { get; set; }

Nilai Properti

string

IsExtraSamplesPresent

Dapatkan nilai yang menunjukkan apakah sampel tambahan hadir.

public bool IsExtraSamplesPresent { get; }

Nilai Properti

bool

IsTiled

Dapatkan nilai yang menunjukkan apakah gambar itu tertutup.

public bool IsTiled { get; }

Nilai Properti

bool

IsValid

Dapatkan nilai yang menunjukkan apakah Aspose.Imaging.ImageOptions.TiffOptions telah terkonfigurasi dengan benar.

public bool IsValid { get; }

Nilai Properti

bool

MaxSampleValue

Dapatkan atau menetapkan nilai sampel max.

public ushort[] MaxSampleValue { get; set; }

Nilai Properti

ushort [ ]

Exceptions

ArgumentNullException

Nilai

ArgumentOutOfRangeException

Nilai;Jangka panjang harus sesuai dengan sampel per piksel.

MinSampleValue

Dapatkan atau menetapkan nilai sampel min.

public ushort[] MinSampleValue { get; set; }

Nilai Properti

ushort [ ]

Exceptions

ArgumentNullException

Nilai

ArgumentOutOfRangeException

Nilai;Jangka panjang harus sesuai dengan sampel per piksel.

Orientation

Dapatkan atau menetapkan orientasi.

public TiffOrientations Orientation { get; set; }

Nilai Properti

TiffOrientations

PageName

Dapatkan atau menetapkan nama halaman.

public string PageName { get; set; }

Nilai Properti

string

PageNumber

Dapatkan atau menetapkan tag nomor halaman.

public ushort[] PageNumber { get; set; }

Nilai Properti

ushort [ ]

Exceptions

ArgumentNullException

Nilai

ArgumentOutOfRangeException

nilai;Tunggu 2 nilai dalam urutan: PageNumber[0] adalah nomor halaman dan PageNumber[1] adalah jumlah halaman dalam dokumen.

Palette

Dapatkan atau menetapkan palet warna.

public override IColorPalette Palette { get; set; }

Nilai Properti

IColorPalette

Photometric

Dapatkan atau menetapkan fotometrik.

public TiffPhotometrics Photometric { get; set; }

Nilai Properti

TiffPhotometrics

Examples

Contoh ini menunjukkan cara membuat gambar TIFF dari scratch dan menyimpannya ke file.

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

Contoh berikut menunjukkan bagaimana untuk menyusun TIFF mutlipage dari gambar raster individu.

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

Contoh berikut menunjukkan cara membuat salinan grafis dari bingkai yang ada dan menambahkan ke gambar 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();
                                                                                                                      }

Contoh ini menunjukkan cara menyimpan gambar raster ke format TIFF menggunakan berbagai opsi.

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

Contoh ini menunjukkan cara membuat gambar TIFF dengan 2 bingkai dan menyimpannya ke file.

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

Dapatkan atau menetapkan konfigurasi planar.

public TiffPlanarConfigs PlanarConfiguration { get; set; }

Nilai Properti

TiffPlanarConfigs

Examples

Contoh ini menunjukkan cara membuat gambar TIFF dari scratch dan menyimpannya ke file.

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

Contoh ini menunjukkan cara menyimpan gambar raster ke format TIFF menggunakan berbagai opsi.

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

Contoh ini menunjukkan cara membuat gambar TIFF dengan 2 bingkai dan menyimpannya ke file.

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

Dapatkan atau menetapkan prediktor untuk kompresi LZW.

public TiffPredictor Predictor { get; set; }

Nilai Properti

TiffPredictor

Examples

Contoh ini menunjukkan cara menyimpan gambar raster ke format TIFF menggunakan berbagai opsi.

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

Dapatkan atau menetapkan nilai yang menunjukkan apakah komponen harus dipredulsifkan.

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

Nilai Properti

bool

ResolutionSettings

Dapatkan atau menetapkan pengaturan resolusi.

public override ResolutionSetting ResolutionSettings { get; set; }

Nilai Properti

ResolutionSetting

ResolutionUnit

Dapatkan atau menetapkan unit resolusi.

public TiffResolutionUnits ResolutionUnit { get; set; }

Nilai Properti

TiffResolutionUnits

RowsPerStrip

Dapatkan atau menetapkan baris per strip.

public uint RowsPerStrip { get; set; }

Nilai Properti

uint

SampleFormat

Dapatkan atau menetapkan format sampel.

public TiffSampleFormats[] SampleFormat { get; set; }

Nilai Properti

TiffSampleFormats [ ]

Exceptions

ArgumentNullException

Nilai

ArgumentOutOfRangeException

Nilai;Jangka panjang harus sesuai dengan sampel per piksel.

SamplesPerPixel

Untuk mengubah nilai properti ini, gunakan Aspose.Imaging.ImageOptions.TiffOptions.BitsPerSample properti setter.

public ushort SamplesPerPixel { get; }

Nilai Properti

ushort

ScannerManufacturer

Dapatkan atau menetapkan produsen scanner.

public string ScannerManufacturer { get; set; }

Nilai Properti

string

ScannerModel

Dapatkan atau menetapkan model scanner.

public string ScannerModel { get; set; }

Nilai Properti

string

SmaxSampleValue

Nilai memiliki jenis medan yang paling cocok dengan data sampel (Byte, Short atau Long type).

public uint[] SmaxSampleValue { get; set; }

Nilai Properti

uint [ ]

SminSampleValue

Nilai memiliki jenis medan yang paling cocok dengan data sampel (Byte, Short atau Long type).

public uint[] SminSampleValue { get; set; }

Nilai Properti

uint [ ]

SoftwareType

Dapatkan atau menetapkan jenis perangkat lunak.

public string SoftwareType { get; set; }

Nilai Properti

string

StripByteCounts

Dapatkan atau menetapkan strip byte menghitung.

public ulong[] StripByteCounts { get; set; }

Nilai Properti

ulong [ ]

StripOffsets

Dapatkan atau meletakkan strip offset.

public ulong[] StripOffsets { get; set; }

Nilai Properti

ulong [ ]

SubFileType

Dapatkan atau menetapkan indikasi umum jenis data yang terkandung dalam subfile ini.

public TiffNewSubFileTypes SubFileType { get; set; }

Nilai Properti

TiffNewSubFileTypes

TagCount

Dapatkan tag count.

public int TagCount { get; }

Nilai Properti

int

Tags

Dapatkan atau menetapkan tag.

public TiffDataType[] Tags { get; set; }

Nilai Properti

TiffDataType [ ]

TargetPrinter

Dapatkan atau menetapkan pencetak sasaran.

public string TargetPrinter { get; set; }

Nilai Properti

string

Threshholding

Mendapatkan atau menetapkan penghalang.

public TiffThresholds Threshholding { get; set; }

Nilai Properti

TiffThresholds

TileByteCounts

Dapatkan atau menetapkan tile byte menghitung.

public ulong[] TileByteCounts { get; set; }

Nilai Properti

ulong [ ]

TileLength

Gets ot menetapkan panjang tile.

public uint TileLength { get; set; }

Nilai Properti

uint

TileOffsets

Mendapatkan atau menetapkan tile offset.

public ulong[] TileOffsets { get; set; }

Nilai Properti

ulong [ ]

TileWidth

Gets ot menetapkan lebar tile.

public uint TileWidth { get; set; }

Nilai Properti

uint

TotalPages

Dapatkan total halaman.

public ushort TotalPages { get; }

Nilai Properti

ushort

ValidTagCount

Ini bukan jumlah tag total tetapi jumlah tag yang dapat disimpan.

public int ValidTagCount { get; }

Nilai Properti

int

Pengarang XPA

Dapatkan atau menetapkan penulis gambar, yang digunakan oleh Windows Explorer.

public string XPAuthor { get; set; }

Nilai Properti

string

XPCommentasi

Dapatkan atau menetapkan komentar pada gambar, yang digunakan oleh Windows Explorer.

public string XPComment { get; set; }

Nilai Properti

string

Kata-Kata KPK

Dapatkan atau menetapkan gambar subjek, yang digunakan oleh Windows Explorer.

public string XPKeywords { get; set; }

Nilai Properti

string

XPSubject

Dapatkan atau menetapkan informasi tentang gambar, yang digunakan oleh Windows Explorer.

public string XPSubject { get; set; }

Nilai Properti

string

XTitle

Dapatkan atau menetapkan informasi tentang gambar, yang digunakan oleh Windows Explorer.

public string XPTitle { get; set; }

Nilai Properti

string

Xposition

Dapatkan atau menetapkan posisi x.

public TiffRational Xposition { get; set; }

Nilai Properti

TiffRational

Xresolution

Dapatkan atau menetapkan resolusi x.

public TiffRational Xresolution { get; set; }

Nilai Properti

TiffRational

Efektif YCbCr

Dapatkan atau menetapkan YCbCrCoefficients.

public TiffRational[] YCbCrCoefficients { get; set; }

Nilai Properti

TiffRational [ ]

Exceptions

TiffImageException

Invalid count of rational coefficient values. harus sama dengan 3.

ArgumentNullException

Nilai

YCbCrSubsampling

Dapatkan atau menetapkan faktor subsampling untuk YCbCr fotometric.

public ushort[] YCbCrSubsampling { get; set; }

Nilai Properti

ushort [ ]

Examples

Contoh ini menunjukkan cara menyimpan gambar raster ke format TIFF menggunakan berbagai opsi.

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

Panjang medan yang tidak sah.YCbCrPakaian medan harus mengandung dua nilai.

ArgumentNullException

Nilai

Yposition

Mendapatkan atau menetapkan posisi y.

public TiffRational Yposition { get; set; }

Nilai Properti

TiffRational

Yresolution

Dapatkan atau menetapkan resolusi y.

public TiffRational Yresolution { get; set; }

Nilai Properti

TiffRational

Methods

AddTag(TiffDataType)

Menambahkan tag baru.

public void AddTag(TiffDataType tagToAdd)

Parameters

tagToAdd TiffDataType

Tag untuk ditambahkan.

AddTags(TiffDataType[])

Tambahkan tag tersebut.

public void AddTags(TiffDataType[] tagsToAdd)

Parameters

tagsToAdd TiffDataType [ ]

Tag yang harus ditambahkan.

Clone()

mengkloning kasus ini.

public override ImageOptionsBase Clone()

Returns

ImageOptionsBase

Kembali ke klon yang mendalam.

GetTagByType(TiffTags)

Dapatkan contoh tag per tipe.

public TiffDataType GetTagByType(TiffTags tagKey)

Parameters

tagKey TiffTags

Tag yang kunci.

Returns

TiffDataType

Contoh dari tag jika ada atau null sebaliknya.

GetValidTagsCount(TiffDataType[])

Dapatkan tag valid count.

public static int GetValidTagsCount(TiffDataType[] tags)

Parameters

tags TiffDataType [ ]

Tag untuk validasi.

Returns

int

Jumlah tag yang valid.

IsTagPresent(TiffTags)

Menentukan apakah tag hadir dalam opsi atau tidak.

public bool IsTagPresent(TiffTags tag)

Parameters

tag TiffTags

Tag id untuk memeriksa.

Returns

bool

‘kebenaran’ jika tag hadir; jika tidak, ‘palsu’.

RemoveTag(TiffTags)

Menghapus tag tersebut.

public bool RemoveTag(TiffTags tag)

Parameters

tag TiffTags

Tag yang harus dihapus.

Returns

bool

benar jika berhasil dihapus

RemoveTags(Perkembangan TiffTags[])

Menghapus tag tersebut.

public bool RemoveTags(params TiffTags[] tags)

Parameters

tags TiffTags [ ]

Tag yang harus dihapus.

Returns

bool

benar Jika ukuran koleksi tag berubah.

Validate()

Validasi apakah opsi memiliki kombinasi tag yang valid

public void Validate()
 Indonesia