Class JpegImage

Class JpegImage

Nazwa przestrzeń: Aspose.Imaging.FileFormats.Jpeg Zgromadzenie: Aspose.Imaging.dll (25.4.0)

Efektywnie manipuluj obrazami rasterów JPEG za pomocą naszej API, oferując wsparciedla różnych profilów kolorowych, takich jak RGB i CMYK, dostosowywane bity na pikselRozdzielczość i przetwarzanie kontenerów metadanych EXIF, JFIF i XMP.Ciesz się automatyczną rotacją opartą na danych orientacyjnych i wybierz spośród różnychpoziomy kompresji, w tym bez strat JPEG, aby osiągnąć optymalną jakość obrazuZrób równowagę wielkości dla swoich projektów.

[JsonObject(MemberSerialization.OptIn)]
public sealed class JpegImage : RasterCachedImage, IDisposable, IObjectWithBounds, IRasterImageArgb32PixelLoader, IRasterImageRawDataLoader, IHasXmpData, IHasJpegExifData, IHasExifData, IHasMetadata

Inheritance

object DisposableObject DataStreamSupporter Image RasterImage RasterCachedImage JpegImage

Implements

IDisposable , IObjectWithBounds , IRasterImageArgb32PixelLoader , IRasterImageRawDataLoader , IHasXmpData , IHasJpegExifData , IHasExifData , IHasMetadata

Dziedziczeni członkowie

RasterCachedImage.CacheData() , RasterCachedImage.Blend(Point, RasterImage, Rectangle, byte) , RasterCachedImage.Resize(int, int, ResizeType) , RasterCachedImage.Resize(int, int, ImageResizeSettings) , RasterCachedImage.RotateFlip(RotateFlipType) , RasterCachedImage.Rotate(float, bool, Color) , RasterCachedImage.Crop(Rectangle) , RasterCachedImage.Dither(DitheringMethod, int, IColorPalette) , RasterCachedImage.Grayscale() , RasterCachedImage.NormalizeHistogram() , RasterCachedImage.BinarizeFixed(byte) , RasterCachedImage.BinarizeOtsu() , RasterCachedImage.BinarizeBradley(double, int) , RasterCachedImage.BinarizeBradley(double) , RasterCachedImage.AdjustBrightness(int) , RasterCachedImage.AdjustContrast(float) , RasterCachedImage.AdjustGamma(float, float, float) , RasterCachedImage.AdjustGamma(float) , RasterCachedImage.IsCached , RasterImage.RemoveMetadata() , RasterImage.Save(Stream, ImageOptionsBase, Rectangle) , RasterImage.GetModifyDate(bool) , RasterImage.Dither(DitheringMethod, int) , RasterImage.Dither(DitheringMethod, int, IColorPalette) , RasterImage.GetDefaultPixels(Rectangle, IPartialArgb32PixelLoader) , RasterImage.GetDefaultRawData(Rectangle, IPartialRawDataLoader, RawDataSettings) , RasterImage.GetDefaultArgb32Pixels(Rectangle) , RasterImage.GetDefaultRawData(Rectangle, RawDataSettings) , RasterImage.GetArgb32Pixel(int, int) , RasterImage.GetPixel(int, int) , RasterImage.SetArgb32Pixel(int, int, int) , RasterImage.SetPixel(int, int, Color) , RasterImage.ReadScanLine(int) , RasterImage.ReadArgb32ScanLine(int) , RasterImage.WriteScanLine(int, Color[]) , RasterImage.WriteArgb32ScanLine(int, int[]) , RasterImage.LoadPartialArgb32Pixels(Rectangle, IPartialArgb32PixelLoader) , RasterImage.LoadPartialPixels(Rectangle, IPartialPixelLoader) , RasterImage.LoadArgb32Pixels(Rectangle) , RasterImage.LoadArgb64Pixels(Rectangle) , RasterImage.LoadPartialArgb64Pixels(Rectangle, IPartialArgb64PixelLoader) , RasterImage.LoadPixels(Rectangle) , RasterImage.LoadCmykPixels(Rectangle) , RasterImage.LoadCmyk32Pixels(Rectangle) , RasterImage.LoadRawData(Rectangle, RawDataSettings, IPartialRawDataLoader) , RasterImage.LoadRawData(Rectangle, Rectangle, RawDataSettings, IPartialRawDataLoader) , RasterImage.SaveRawData(byte[], int, Rectangle, RawDataSettings) , RasterImage.SaveArgb32Pixels(Rectangle, int[]) , RasterImage.SavePixels(Rectangle, Color[]) , RasterImage.SaveCmykPixels(Rectangle, CmykColor[]) , RasterImage.SaveCmyk32Pixels(Rectangle, int[]) , RasterImage.SetResolution(double, double) , RasterImage.SetPalette(IColorPalette, bool) , RasterImage.Resize(int, int, ImageResizeSettings) , RasterImage.Rotate(float, bool, Color) , RasterImage.Rotate(float) , RasterImage.BinarizeFixed(byte) , RasterImage.BinarizeOtsu() , RasterImage.BinarizeBradley(double) , RasterImage.BinarizeBradley(double, int) , RasterImage.Blend(Point, RasterImage, Rectangle, byte) , RasterImage.Blend(Point, RasterImage, byte) , RasterImage.Grayscale() , RasterImage.NormalizeHistogram() , RasterImage.AdjustBrightness(int) , RasterImage.AdjustContrast(float) , RasterImage.AdjustGamma(float, float, float) , RasterImage.AdjustGamma(float) , RasterImage.GetSkewAngle() , RasterImage.NormalizeAngle() , RasterImage.NormalizeAngle(bool, Color) , RasterImage.Filter(Rectangle, FilterOptionsBase) , RasterImage.ReplaceColor(Color, byte, Color) , RasterImage.ReplaceColor(int, byte, int) , RasterImage.ReplaceNonTransparentColors(Color) , RasterImage.ReplaceNonTransparentColors(int) , RasterImage.ToBitmap() , RasterImage.PremultiplyComponents , RasterImage.UseRawData , RasterImage.UpdateXmpData , RasterImage.XmpData , RasterImage.RawIndexedColorConverter , RasterImage.RawCustomColorConverter , RasterImage.RawFallbackIndex , RasterImage.RawDataSettings , RasterImage.UsePalette , RasterImage.RawDataFormat , RasterImage.RawLineSize , RasterImage.IsRawDataAvailable , RasterImage.HorizontalResolution , RasterImage.VerticalResolution , RasterImage.HasTransparentColor , RasterImage.HasAlpha , RasterImage.TransparentColor , RasterImage.ImageOpacity , Image.CanLoad(string) , Image.CanLoad(string, LoadOptions) , Image.CanLoad(Stream) , Image.CanLoad(Stream, LoadOptions) , Image.Create(ImageOptionsBase, int, int) , Image.Create(Image[]) , Image.Create(MultipageCreateOptions) , Image.Create(string[], bool) , Image.Create(string[]) , Image.Create(Image[], bool) , Image.GetFileFormat(string) , Image.GetFileFormat(Stream) , Image.GetFittingRectangle(Rectangle, int, int) , Image.GetFittingRectangle(Rectangle, int[], int, int) , Image.Load(string, LoadOptions) , Image.Load(string) , Image.Load(Stream, LoadOptions) , Image.Load(Stream) , Image.GetProportionalWidth(int, int, int) , Image.GetProportionalHeight(int, int, int) , Image.RemoveMetadata() , Image.CanSave(ImageOptionsBase) , Image.Resize(int, int) , Image.Resize(int, int, ResizeType) , Image.Resize(int, int, ImageResizeSettings) , Image.GetDefaultOptions(object[]) , Image.GetOriginalOptions() , Image.ResizeWidthProportionally(int) , Image.ResizeHeightProportionally(int) , Image.ResizeWidthProportionally(int, ResizeType) , Image.ResizeHeightProportionally(int, ResizeType) , Image.ResizeWidthProportionally(int, ImageResizeSettings) , Image.ResizeHeightProportionally(int, ImageResizeSettings) , Image.RotateFlip(RotateFlipType) , Image.Rotate(float) , Image.Crop(Rectangle) , Image.Crop(int, int, int, int) , Image.Save() , Image.Save(string) , Image.Save(string, ImageOptionsBase) , Image.Save(string, ImageOptionsBase, Rectangle) , Image.Save(Stream, ImageOptionsBase) , Image.Save(Stream, ImageOptionsBase, Rectangle) , Image.GetSerializedStream(ImageOptionsBase, Rectangle, out int) , Image.SetPalette(IColorPalette, bool) , Image.BitsPerPixel , Image.Bounds , Image.Container , Image.Height , Image.Palette , Image.UsePalette , Image.Size , Image.Width , Image.InterruptMonitor , Image.BufferSizeHint , Image.AutoAdjustPalette , Image.HasBackgroundColor , Image.FileFormat , Image.BackgroundColor , DataStreamSupporter.CacheData() , DataStreamSupporter.Save() , DataStreamSupporter.Save(Stream) , DataStreamSupporter.Save(string) , DataStreamSupporter.Save(string, bool) , DataStreamSupporter.DataStreamContainer , DataStreamSupporter.IsCached , DisposableObject.Dispose() , DisposableObject.Disposed , object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Examples

Dostęp do notatek producenta kamery w obrazie JPEG.

using (var image = (JpegImage)Image.Load("Sample.jpg"))
                                                                {
                                                                    foreach (var makerNote in image.ExifData.MakerNotes)
                                                                    {
                                                                        Console.WriteLine("Name = {0}, Value = {1}", makerNote.Name, makerNote.Value);
                                                                    }
                                                                }

Przykład pokazuje, jak pobrać JpegImage z pliku.

string dir = "c:\\temp\\";

                                                                 // Load a JPEG image from a file.
                                                                 using (Aspose.Imaging.FileFormats.Jpeg.JpegImage jpegImage = new Aspose.Imaging.FileFormats.Jpeg.JpegImage(dir + "sample.jpg"))
                                                                 {
                                                                     // Do some image processing.
                                                                     // Save to another JPEG file.
                                                                     jpegImage.Save(dir + "sample.output.jpg");
                                                                 }

Constructors

JpegImage(strumień)

Klasa Aspose.Imaging.FileFormats.Jpeg.JPEGImage rozpoczyna się bez wysiłku, odwołując się dokonstruktor z określonymi parametrami ścieżek. ta konstrukcja umożliwia bezprzewodoweTworzenie obrazów JPEG, zapewniając szybką integrację do projektów z łatwością.

public JpegImage(string path)

Parameters

path string

Ścieżka do ładowania obrazu z i inicjalizować pixelów i palet danych z.

Examples

Przykład pokazuje, jak pobrać JpegImage z pliku.

string dir = "c:\\temp\\";

                                                                 // Load a JPEG image from a file.
                                                                 using (Aspose.Imaging.FileFormats.Jpeg.JpegImage jpegImage = new Aspose.Imaging.FileFormats.Jpeg.JpegImage(dir + "sample.jpg"))
                                                                 {
                                                                     // Do some image processing.
                                                                     // Save to another JPEG file.
                                                                     jpegImage.Save(dir + "sample.output.jpg");
                                                                 }

JpegImage(Stream)

Inicjalizuj obiekt obrazu JPEG za pomocą klasy Aspose.Imaging.FileFormats.Jpeg.parametr strumienia. ten konstruktor ułatwia proces pracy z JPEGobrazów, oferując prosty podejście do ich integracji w projektachbez wysiłku.

public JpegImage(Stream stream)

Parameters

stream Stream

Strumień do ładowania obrazu z i inicjalizować pixelów i palet danych z.

Examples

Przykład pokazuje, jak pobrać JpegImage z przepływu plików.

string dir = "c:\\temp\\";

                                                                        // Load a JPEG image from a file stream.
                                                                        using (System.IO.Stream stream = System.IO.File.OpenRead(dir + "sample.jpg"))
                                                                        {
                                                                            using (Aspose.Imaging.FileFormats.Jpeg.JpegImage jpegImage = new Aspose.Imaging.FileFormats.Jpeg.JpegImage(stream))
                                                                            {
                                                                                // Do some image processing.
                                                                                // Save to another JPEG file.
                                                                                jpegImage.Save(dir + "sample.output.jpg");
                                                                            }
                                                                        }

JpegImage(RasterImage)

Inicjalizuj nową instancję klasy Aspose.Imaging.FileFormats.Jpeg.JPEGImage z obrazem rasterowymTen konstruktor zapewnia wygodny sposób na tworzenie obrazów JPEGbezpośrednio z obrazu raster, ułatwiając przepływ pracy do pracy z obrazami JPEGw Twoich aplikacjach.

public JpegImage(RasterImage rasterImage)

Parameters

rasterImage RasterImage

Zdjęcie do inicjalizacji pikseli i palety danych z.

Examples

Przykład pokazuje, jak pobrać JpegImage z innego RasterImages.

string dir = "c:\\temp\\";

                                                                              // Load a JPEG image from another raster image.
                                                                              // First, create a temporal PNG image that will be a foundation for building a JPEG image.
                                                                              // You can also load PNG image from a file or use an image of any other raster format.
                                                                              Aspose.Imaging.ImageOptions.PngOptions createOptions = new Aspose.Imaging.ImageOptions.PngOptions();
                                                                              createOptions.Source = new Aspose.Imaging.Sources.StreamSource(new System.IO.MemoryStream(), false);
                                                                              using (Aspose.Imaging.RasterImage rasterImage = (Aspose.Imaging.RasterImage)Aspose.Imaging.Image.Create(createOptions, 100, 100))
                                                                              {
                                                                                  // Fill the entire PNG image in red.
                                                                                  Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(rasterImage);
                                                                                  Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.Red);
                                                                                  graphics.FillRectangle(brush, rasterImage.Bounds);

                                                                                  // Create a JPEG image based on the PNG image.
                                                                                  using (Aspose.Imaging.FileFormats.Jpeg.JpegImage jpegImage = new Aspose.Imaging.FileFormats.Jpeg.JpegImage(rasterImage))
                                                                                  {
                                                                                      // Save to a JPEG file
                                                                                      jpegImage.Save(dir + "output.jpg");
                                                                                  }
                                                                              }

JpegImage(i int, int)

Tworzenie nowej instancji klasy Aspose.Imaging.FileFormats.Jpeg.PigImage z określoną szerokościąi parametry wysokości. ten konstruktor umożliwia tworzenie obrazów JPEG zDostosowane wymiary, zapewniając elastyczność w zarządzaniu rozmiarami obrazu w aplikacji.

public JpegImage(int width, int height)

Parameters

width int

Szerokość obrazu.

height int

Wysokość obrazu.

Examples

Poniższy przykład pokazuje, jak utworzyć obraz JPEG określonego rozmiaru.

string dir = "c:\\temp\\";

                                                                                      // Create a JPEG image of 100x100 px.
                                                                                      using (Aspose.Imaging.FileFormats.Jpeg.JpegImage jpegImage = new Aspose.Imaging.FileFormats.Jpeg.JpegImage(100, 100))
                                                                                      {
                                                                                          // Do some image processing.
                                                                                          // Save to a file.
                                                                                          jpegImage.Save(dir + "output.jpg");
                                                                                      }

Poniższy przykład pobiera obraz BMP i przechowuje go do JPEG za pomocą różnych opcji zapasów.

string dir = "c:\\temp\\";

                                                                                                   // Load a BMP image from a file.
                                                                                                   using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.bmp"))
                                                                                                   {
                                                                                                       // Do some image processing.

                                                                                                       // Use additional options to specify the desired image parameters.
                                                                                                       Aspose.Imaging.ImageOptions.JpegOptions saveOptions = new Aspose.Imaging.ImageOptions.JpegOptions();

                                                                                                       // The number of bits per channel is 8.
                                                                                                       // When a palette is used, the color index is stored in the image data instead of the color itself.
                                                                                                       saveOptions.BitsPerChannel = 8;

                                                                                                       // Set the progressive type of compression.
                                                                                                       saveOptions.CompressionType = Aspose.Imaging.FileFormats.Jpeg.JpegCompressionMode.Progressive;

                                                                                                       // Set the image quality. It is a value between 1 and 100.
                                                                                                       saveOptions.Quality = 100;

                                                                                                       // Set the horizontal/vertical resolution to 96 dots per inch.
                                                                                                       saveOptions.ResolutionSettings = new Aspose.Imaging.ResolutionSetting(96.0, 96.0);
                                                                                                       saveOptions.ResolutionUnit = Aspose.Imaging.ResolutionUnit.Inch;

                                                                                                       // If the source image is colored, it will be converted to grayscaled.
                                                                                                       saveOptions.ColorType = Aspose.Imaging.FileFormats.Jpeg.JpegCompressionColorMode.Grayscale;

                                                                                                       // Use a palette to reduce the output size.
                                                                                                       saveOptions.Palette = Aspose.Imaging.ColorPaletteHelper.Create8BitGrayscale(false);

                                                                                                       image.Save(dir + "sample.palettized.jpg", saveOptions);
                                                                                                   }

JpegImage(Opcje JpegOptions, int , int)

Zainicjalizuj nowy obiekt Aspose.Imaging.FileFormats.Jpeg.Dzwiastun z opcjami JPEG.Konstruktor ten umożliwia dostosowanie różnych ustawień do obrazu JPEG, takich jak:jako poziom kompresji, jakość i dodatkowe parametry, zapewniając precyzyjną kontrolęw połączeniu z wynikającym formatem obrazu.

public JpegImage(JpegOptions jpegOptions, int width, int height)

Parameters

jpegOptions JpegOptions

Opcje JPEG.

width int

Szerokość obrazu.

height int

Wysokość obrazu.

Examples

Poniższy przykład pobiera obraz BMP i przechowuje go do JPEG za pomocą różnych opcji zapasów.

string dir = "c:\\temp\\";

                                                                                                   // Load a BMP image from a file.
                                                                                                   using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.bmp"))
                                                                                                   {
                                                                                                       // Do some image processing.

                                                                                                       // Use additional options to specify the desired image parameters.
                                                                                                       Aspose.Imaging.ImageOptions.JpegOptions saveOptions = new Aspose.Imaging.ImageOptions.JpegOptions();

                                                                                                       // The number of bits per channel is 8.
                                                                                                       // When a palette is used, the color index is stored in the image data instead of the color itself.
                                                                                                       saveOptions.BitsPerChannel = 8;

                                                                                                       // Set the progressive type of compression.
                                                                                                       saveOptions.CompressionType = Aspose.Imaging.FileFormats.Jpeg.JpegCompressionMode.Progressive;

                                                                                                       // Set the image quality. It is a value between 1 and 100.
                                                                                                       saveOptions.Quality = 100;

                                                                                                       // Set the horizontal/vertical resolution to 96 dots per inch.
                                                                                                       saveOptions.ResolutionSettings = new Aspose.Imaging.ResolutionSetting(96.0, 96.0);
                                                                                                       saveOptions.ResolutionUnit = Aspose.Imaging.ResolutionUnit.Inch;

                                                                                                       // If the source image is colored, it will be converted to grayscaled.
                                                                                                       saveOptions.ColorType = Aspose.Imaging.FileFormats.Jpeg.JpegCompressionColorMode.Grayscale;

                                                                                                       // Use a palette to reduce the output size.
                                                                                                       saveOptions.Palette = Aspose.Imaging.ColorPaletteHelper.Create8BitGrayscale(false);

                                                                                                       image.Save(dir + "sample.palettized.jpg", saveOptions);
                                                                                                   }

Poniższy przykład pokazuje, jak utworzyć obraz JPEG określonego rozmiaru za pomocą określonych parametrów.

string dir = "c:\\temp\\";

                                                                                                                    // Create a JPEG image of 100x100 px.
                                                                                                                    // Use additional options to specify the desired image parameters.
                                                                                                                    Aspose.Imaging.ImageOptions.JpegOptions createOptions = new Aspose.Imaging.ImageOptions.JpegOptions();

                                                                                                                    // The number of bits per channel is 8, 8, 8 for Y, Cr, Cb components accordingly.
                                                                                                                    createOptions.BitsPerChannel = 8;

                                                                                                                    // Set the progressive type of compression.
                                                                                                                    createOptions.CompressionType = Aspose.Imaging.FileFormats.Jpeg.JpegCompressionMode.Progressive;

                                                                                                                    // Set the image quality. It is a value between 1 and 100.
                                                                                                                    createOptions.Quality = 100;

                                                                                                                    // Set the horizontal/vertical resolution to 96 dots per inch.
                                                                                                                    createOptions.ResolutionSettings = new Aspose.Imaging.ResolutionSetting(96.0, 96.0);
                                                                                                                    createOptions.ResolutionUnit = Aspose.Imaging.ResolutionUnit.Inch;

                                                                                                                    // This is a standard option for JPEG images.
                                                                                                                    // Two chroma components (Cb and Cr) can be bandwidth-reduced, subsampled, compressed.
                                                                                                                    createOptions.ColorType = Aspose.Imaging.FileFormats.Jpeg.JpegCompressionColorMode.YCbCr;

                                                                                                                    using (Aspose.Imaging.FileFormats.Jpeg.JpegImage jpegImage = new Aspose.Imaging.FileFormats.Jpeg.JpegImage(createOptions, 100, 100))
                                                                                                                    {
                                                                                                                        Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(jpegImage);

                                                                                                                        Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
                                                                                                                            new Aspose.Imaging.Point(0, 0),
                                                                                                                            new Aspose.Imaging.Point(jpegImage.Width, jpegImage.Height),
                                                                                                                            Aspose.Imaging.Color.Yellow,
                                                                                                                            Aspose.Imaging.Color.Blue);

                                                                                                                        // Fill the image with a grayscale gradient
                                                                                                                        graphics.FillRectangle(gradientBrush, jpegImage.Bounds);

                                                                                                                        // Save to a file.
                                                                                                                        jpegImage.Save(dir + "output.explicitoptions.jpg");
                                                                                                                    }

Properties

BitsPerPixel

Odzyskuj głębokość piksela obrazu bez wysiłku z tą własnością, oferującwgląd w bogactwo kolorów lub grayscale reprezentacji. czy jest towibracyjna fotografia lub monochromatyczna ilustracja, ta nieruchomość zapewnia kluczoweInformacje o złożoności wizualnej obrazu.

public override int BitsPerPixel { get; }

Wartość nieruchomości

int

CmykColorProfile

Profil kolorowy CMYK powiązany z obrazami JPEG i YCCK zapewnia precyzjęKonwersja kolorów i lojalność. działa w połączeniu z RGBColorProfile dogwarantuje precyzyjną reprezentację kolorów na różnych urządzeniach i aplikacjach.To parowanie jest kluczowe dla utrzymania spójności w kolorze renderingu iOsiągnięcie optymalnej jakości obrazu.

public StreamSource CmykColorProfile { get; set; }

Wartość nieruchomości

StreamSource

Examples

Poniższy przykład ładuje PNG i przechowuje go do CMYK JPEG za pomocą profilu ICC dostosowanego. Następnie pobiera CMYK JPG i odtwarza go z powrotem do pNG. Konwersja koloru z RGB do cmYK i z CMYN do RMB odbywa się za pośrednictwem dostosowań profili MCC.

string dir = "c:\\temp\\";

                                                                                                                                                                                                                                                // Load PNG and save it to CMYK JPEG
                                                                                                                                                                                                                                                using (Aspose.Imaging.FileFormats.Png.PngImage image = (Aspose.Imaging.FileFormats.Png.PngImage)Image.Load(dir + "sample.png"))
                                                                                                                                                                                                                                                {
                                                                                                                                                                                                                                                    using (System.IO.Stream rgbProfileStream = System.IO.File.OpenRead(dir + "eciRGB_v2.icc"))
                                                                                                                                                                                                                                                    using (System.IO.Stream cmykProfileStream = System.IO.File.OpenRead(dir + "ISOcoated_v2_FullGamut4.icc"))
                                                                                                                                                                                                                                                    {
                                                                                                                                                                                                                                                        Aspose.Imaging.ImageOptions.JpegOptions saveOptions = new Aspose.Imaging.ImageOptions.JpegOptions();
                                                                                                                                                                                                                                                        saveOptions.ColorType = Aspose.Imaging.FileFormats.Jpeg.JpegCompressionColorMode.Cmyk;

                                                                                                                                                                                                                                                        // Use custom ICC profiles
                                                                                                                                                                                                                                                        saveOptions.RgbColorProfile = new Aspose.Imaging.Sources.StreamSource(rgbProfileStream);
                                                                                                                                                                                                                                                        saveOptions.CmykColorProfile = new Aspose.Imaging.Sources.StreamSource(cmykProfileStream);

                                                                                                                                                                                                                                                        image.Save(dir + "output.cmyk.jpg", saveOptions);
                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                }

                                                                                                                                                                                                                                                // Load CMYK JPEG and save it to PNG
                                                                                                                                                                                                                                                using (Aspose.Imaging.FileFormats.Jpeg.JpegImage image = (Aspose.Imaging.FileFormats.Jpeg.JpegImage)Image.Load(dir + "output.cmyk.jpg"))
                                                                                                                                                                                                                                                {
                                                                                                                                                                                                                                                    using (System.IO.Stream rgbProfileStream = System.IO.File.OpenRead(dir + "eciRGB_v2.icc"))
                                                                                                                                                                                                                                                    using (System.IO.Stream cmykProfileStream = System.IO.File.OpenRead(dir + "ISOcoated_v2_FullGamut4.icc"))
                                                                                                                                                                                                                                                    {
                                                                                                                                                                                                                                                        // Use custom ICC profiles
                                                                                                                                                                                                                                                        image.RgbColorProfile = new Aspose.Imaging.Sources.StreamSource(rgbProfileStream);
                                                                                                                                                                                                                                                        image.CmykColorProfile = new Aspose.Imaging.Sources.StreamSource(cmykProfileStream);

                                                                                                                                                                                                                                                        Aspose.Imaging.ImageOptions.PngOptions saveOptions = new Aspose.Imaging.ImageOptions.PngOptions();
                                                                                                                                                                                                                                                        image.Save(dir + "output.rgb.png", saveOptions);
                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                }

Comment

Zarządzanie komentarzami pliku JPEG z tą własnością, pozwalając dodać lub odzyskaćopisowe notatki powiązane z obrazem. czy to etykietowanie obrazów zmetadata lub wyświetlając dodatkowy kontekst, ta nieruchomość oferuje elastyczność wOrganizowanie i klasyfikacja plików JPEG.

public string Comment { get; set; }

Wartość nieruchomości

string

DestinationCmykColorProfile

Profil koloru CMYK jest niezbędny do dokładnej konwersji kolorów w zakresie CMYK i YCCK.Zdjęcia JPEG podczas procesu oszczędzania. działa w tandem z RGBColorProfilezapewnienie prawidłowej reprezentacji kolorów, utrzymanie spójności i jakościróżne urządzenia i oprogramowanie. ta synchronizacja jest niezbędna do osiągnięciaDokładne i niezawodne renderowanie kolorów w ostatnich zapisanych obrazach.

public StreamSource DestinationCmykColorProfile { get; set; }

Wartość nieruchomości

StreamSource

DestinationRgbColorProfile

RGBColorProfile jest niezbędny do dokładnej konwersji kolorów CMYK i YCCKZdjęcia JPEG podczas procesu oszczędzania.Kiedy parowane z CMYKColorProfile,Upewnij się, że kolory są prawidłowo renderowane i utrzymuje spójność międzyróżne urządzenia i aplikacje. ta kombinacja jest niezbędna do utrzymaniazamierzoną reprezentację kolorów i osiągnięcie wysokiej jakości produkcji obrazu.

public StreamSource DestinationRgbColorProfile { get; set; }

Wartość nieruchomości

StreamSource

ExifData

Zarządzanie danymi EXIF z tą własnością, umożliwiając dodanie lub odzyskanie metadanychzwiązanego z obrazem. czy jest to ekstrakcja informacji o kameryustawienia lub modyfikacji istniejących metadanych, ta nieruchomość oferuje elastyczność wZarządzanie kontenerem danych EXIF.

public JpegExifData ExifData { get; set; }

Wartość nieruchomości

JpegExifData

Examples

Poniższy przykład pokazuje, jak wyciągnąć etykiety EXIF z obrazu JPEG.

string dir = "c:\\temp\\";

                                                                                  using (Aspose.Imaging.FileFormats.Jpeg.JpegImage image = (Aspose.Imaging.FileFormats.Jpeg.JpegImage)Image.Load(dir + "original.jpg"))
                                                                                  {
                                                                                      Aspose.Imaging.Exif.ExifData exifData = image.ExifData;

                                                                                      System.Console.WriteLine("The general EXIF data");
                                                                                      System.Console.WriteLine("------------------------------------------");
                                                                                      if (exifData != null)
                                                                                      {
                                                                                          System.Console.WriteLine("The EXIF version: {0}", exifData.ExifVersion);
                                                                                          System.Console.WriteLine("The camera serial number: {0}", exifData.BodySerialNumber);
                                                                                          System.Console.WriteLine("The color space: {0}", exifData.ColorSpace);
                                                                                          System.Console.WriteLine("The brightness: {0}", exifData.BrightnessValue);
                                                                                          System.Console.WriteLine("The contrast: {0}", exifData.Contrast);
                                                                                          System.Console.WriteLine("The gamma: {0}", exifData.Gamma);
                                                                                          System.Console.WriteLine("The sharpness: {0}", exifData.Sharpness);
                                                                                          System.Console.WriteLine("The aperture: {0}", exifData.ApertureValue);
                                                                                          System.Console.WriteLine("The exposure mode: {0}", exifData.ExposureMode);
                                                                                          System.Console.WriteLine("The exposure bias: {0}", exifData.ExposureBiasValue);
                                                                                          System.Console.WriteLine("The exposure time: {0}", exifData.ExposureTime);
                                                                                          System.Console.WriteLine("The focal length: {0}", exifData.FocalLength);
                                                                                          System.Console.WriteLine("The focal plane resolution unit: {0}", exifData.FocalPlaneResolutionUnit);
                                                                                          System.Console.WriteLine("The lens model: {0}", exifData.LensModel);
                                                                                          System.Console.WriteLine("The shutter speed: {0}", exifData.ShutterSpeedValue);
                                                                                      }

                                                                                      System.Console.WriteLine("The JPEG EXIF data");
                                                                                      System.Console.WriteLine("------------------------------------------");
                                                                                      Aspose.Imaging.Exif.JpegExifData jpegExifData = image.ExifData as Aspose.Imaging.Exif.JpegExifData;
                                                                                      if (jpegExifData != null)
                                                                                      {
                                                                                          System.Console.WriteLine("The camera manufacturer: {0}", jpegExifData.Make);
                                                                                          System.Console.WriteLine("The camera model: {0}", jpegExifData.Model);
                                                                                          System.Console.WriteLine("The photometric interpretation: {0}", jpegExifData.PhotometricInterpretation);
                                                                                          System.Console.WriteLine("The artist: {0}", jpegExifData.Artist);
                                                                                          System.Console.WriteLine("The copyright: {0}", jpegExifData.Copyright);
                                                                                          System.Console.WriteLine("The image description: {0}", jpegExifData.ImageDescription);
                                                                                          System.Console.WriteLine("The orientation: {0}", jpegExifData.Orientation);
                                                                                          System.Console.WriteLine("The software: {0}", jpegExifData.Software);
                                                                                      }
                                                                                  }

                                                                                  //The output looks like this:
                                                                                  //The general EXIF data
                                                                                  //------------------------------------------
                                                                                  //The EXIF version: System.Byte[]
                                                                                  //The camera serial number: 7100536
                                                                                  //The color space: SRgb
                                                                                  //The brightness:
                                                                                  //The contrast: Normal
                                                                                  //The gamma:
                                                                                  //The sharpness: 0
                                                                                  //The aperture: 4.64(4643856 / 1000000)
                                                                                  //The exposure mode: Manual
                                                                                  //The exposure bias: 0.67(4 / 6)
                                                                                  //The exposure time: 0.01(1 / 160)
                                                                                  //The focal length: 145.00(1450 / 10)
                                                                                  //The focal plane resolution unit: Cm
                                                                                  //The lens model: 70.0 - 200.0 mm f/ 4.0
                                                                                  //The shutter speed: 7.32(7321928 / 1000000)
                                                                                  //The JPEG EXIF data
                                                                                  //------------------------------------------
                                                                                  //The camera manufacturer: NIKON CORPORATION
                                                                                  //The camera model: NIKON D5
                                                                                  //The photometric interpretation: 0
                                                                                  //The artist: 
                                                                                  //The copyright: 
                                                                                  //The image description:
                                                                                  //The orientation: TopLeft
                                                                                  //The software: Adobe Photoshop Camera Raw 9.9(Macintosh)

FileFormat

Przywróć format obrazu bez wysiłku z tą własnością.cenny wgląd w format pliku, pomagając w bezprzewodowej integracji iKontrola zgodności na różnych platformach i aplikacjach.

public override FileFormat FileFormat { get; }

Wartość nieruchomości

FileFormat

Height

Odzyskuj wysokość obrazu bez wysiłku z tą własnością. zapewnia szybkidostęp do wymiaru pionowego obrazu, umożliwiając efektywneokreślić jego wielkość i stosunek aspektów bez konieczności złożonych obliczeń lubDodatkowe metody

public override int Height { get; }

Wartość nieruchomości

int

HorizontalResolution

Ta nieruchomość umożliwia dostęp do horyzontalnej rozdzielczościAspose.Imaging.RasterImage, mierzone w pikselach na cala. poprzez ustawienie lub odzyskanieta wartość, można dokładnie kontrolować rozdzielczość obrazu, zapewniającspełnia specyficzne wymagania dotyczące jakości i jasności.

public override double HorizontalResolution { get; set; }

Wartość nieruchomości

double

Examples

Poniższy przykład pokazuje, jak ustawić rozdzielczość horyzontalną / pionową obrazu JPEG.

string dir = "c:\\temp\\";

                                                                                                 using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.jpg"))
                                                                                                 {
                                                                                                     Aspose.Imaging.FileFormats.Jpeg.JpegImage jpegImage = (Aspose.Imaging.FileFormats.Jpeg.JpegImage)image;

                                                                                                     // Get horizontal and vertical resolution of the BmpImage
                                                                                                     double horizontalResolution = jpegImage.HorizontalResolution;
                                                                                                     double verticalResolution = jpegImage.VerticalResolution;
                                                                                                     System.Console.WriteLine("The horizontal resolution, in pixels per inch: {0}", horizontalResolution);
                                                                                                     System.Console.WriteLine("The vertical resolution, in pixels per inch: {0}", verticalResolution);

                                                                                                     if (horizontalResolution != 96.0 || verticalResolution != 96.0)
                                                                                                     {
                                                                                                         // Use the SetResolution method for updating both resolution values in a single call.
                                                                                                         System.Console.WriteLine("Set resolution values to 96 dpi");
                                                                                                         jpegImage.SetResolution(96.0, 96.0);

                                                                                                         System.Console.WriteLine("The horizontal resolution, in pixels per inch: {0}", jpegImage.HorizontalResolution);
                                                                                                         System.Console.WriteLine("The vertical resolution, in pixels per inch: {0}", jpegImage.VerticalResolution);
                                                                                                     }

                                                                                                     // The output may look like this:
                                                                                                     // The horizontal resolution, in pixels per inch: 300
                                                                                                     // The vertical resolution, in pixels per inch: 300
                                                                                                     // Set resolution values to 96 dpi
                                                                                                     // The horizontal resolution, in pixels per inch: 96
                                                                                                     // The vertical resolution, in pixels per inch: 96
                                                                                                 }

Remarks

Zazwyczaj wartość ta wynosi zawsze 96 ponieważ różne platformy nie mogą zwrócić rozdzielczości ekranu. Możesz rozważyć użycie metody SetResolution, aby zaktualizować oba wartości rozdzielczości w jednym wezwaniu.

IgnoreEmbeddedColorProfile

Odtwarza lub modyfikuje flagę oznaczającą, czy wbudowany profil kolorowy jestustawiając tę flagę, użytkownicy mogą określić, czy kolor domyślnyprofil powinien być używany zamiast wbudowanego. ta opcja zapewnia większykontrola zarządzania kolorami, ułatwianie dostosowania do spójności iKompatybilność w różnych platformach i aplikacjach.

public bool IgnoreEmbeddedColorProfile { get; set; }

Wartość nieruchomości

bool

Jfif

Ta nieruchomość umożliwia dostęp lub modyfikację JFIF (JPEG File Interchange)Format) danych związanych z obrazem JPEG. JFIF jest standardowym formatem dlawymiana JPEG-kompresowanych obrazów między komputerami i innymi urządzeniami.lub ustawienie tej nieruchomości, można interakcji z danymi JFIF, które mogą obejmowaćInformacje takie jak rozdzielczość obrazu, stosunek aspektu i miniaturę.

public JFIFData Jfif { get; set; }

Wartość nieruchomości

JFIFData

JpegOptions

uzyskanie dostępu do opcji JPEG wykorzystywanych podczas tworzenia lub ładowaniaAspose.Imaging.FileFormats.Jpeg.Zobacz przykłady z łatwością. ta nieruchomość oferuje cenne szczegółyo konkretnych ustawieniach wykorzystywanych, umożliwiając użytkownikom zrozumienie i odtwarzaniePrzetwarzanie obrazu działa efektywnie. czy to poziom kompresji, jakośćustawień, lub innych parametrów, to właściwość zapewnia istotne wgląd wBezprzewodowe manipulacje obrazu.

public JpegOptions JpegOptions { get; }

Wartość nieruchomości

JpegOptions

Examples

Poniższy przykład pokazuje, jak wyciągnąć informacje o nagłówku z obrazu JPEG.

string dir = "c:\\temp\\";

                                                                                               using (Aspose.Imaging.FileFormats.Jpeg.JpegImage image = (Aspose.Imaging.FileFormats.Jpeg.JpegImage)Image.Load(dir + "original.jpg"))
                                                                                               {
                                                                                                   Aspose.Imaging.ImageOptions.JpegOptions jpegOptions = image.JpegOptions;

                                                                                                   System.Console.WriteLine("The number of bits per channel: {0}", jpegOptions.BitsPerChannel);
                                                                                                   System.Console.WriteLine("The max allowed size for all internal buffers: {0}", jpegOptions.BufferSizeHint);
                                                                                                   System.Console.WriteLine("The color type: {0}", jpegOptions.ColorType);
                                                                                                   System.Console.WriteLine("The compression type: {0}", jpegOptions.CompressionType);
                                                                                                   System.Console.WriteLine("The image quality: {0}", jpegOptions.Quality);

                                                                                                   if (jpegOptions.ResolutionSettings != null)
                                                                                                   {
                                                                                                       System.Console.WriteLine("The horizontal resolution: {0}", jpegOptions.ResolutionSettings.HorizontalResolution);
                                                                                                       System.Console.WriteLine("The vertical resolution: {0}", jpegOptions.ResolutionSettings.VerticalResolution);
                                                                                                   }

                                                                                                   for (int i = 0; i < jpegOptions.HorizontalSampling.Length; i++)
                                                                                                   {
                                                                                                       System.Console.WriteLine("The sampling for component {0}: {1}x{2}", i, jpegOptions.HorizontalSampling[i], jpegOptions.VerticalSampling[i]);
                                                                                                   }
                                                                                               }

                                                                                               //The output looks like this:
                                                                                               //The number of bits per channel: 8
                                                                                               //The max allowed size for all internal buffers: 0
                                                                                               //The color type: YCbCr
                                                                                               //The compression type: Baseline
                                                                                               //The image quality: 75
                                                                                               //The sampling for component 0: 1x1
                                                                                               //The sampling for component 1: 1x1
                                                                                               //The sampling for component 2: 1x1

RawDataFormat

Ta nieruchomość odzyskuje surowy format danych obrazu, który wskazuje, w jaki sposóbdane obrazu są strukturowane i kodowane. zrozumienie formatu surowych danych jestniezbędne do skutecznego przetwarzania lub manipulowania danymi obrazowymi.wgląd w podstawową reprezentację obrazu, np. czy jestkompresowane, kodowane w określonym kolorze lub przechowywane w danym plikuDostęp do tej nieruchomości pozwala uzyskać cenne informacje na tematstruktury danych obrazu, umożliwiając wykonywanie różnych operacji lub optymalizacjiDostosowane do konkretnego formatu.

public override PixelDataFormat RawDataFormat { get; }

Wartość nieruchomości

PixelDataFormat

RgbColorProfile

Profil kolorów RGB dla obrazów CMYK i YCCK JPEG zapewnia dokładny kolorKonwersja i reprezentacja. musi być powiązany z CMYKColorProfile doutrzymanie spójności i lojalności w renderowaniu kolorów. ta pary są niezbędne doaplikacje wymagające precyzyjnego zarządzania kolorami i odtwarzania obrazów,Upewnij się, że dane RGB są prawidłowo interpretowane i wyświetlane.

public StreamSource RgbColorProfile { get; set; }

Wartość nieruchomości

StreamSource

Examples

Poniższy przykład ładuje PNG i przechowuje go do CMYK JPEG za pomocą profilu ICC dostosowanego. Następnie pobiera CMYK JPG i odtwarza go z powrotem do pNG. Konwersja koloru z RGB do cmYK i z CMYN do RMB odbywa się za pośrednictwem dostosowań profili MCC.

string dir = "c:\\temp\\";

                                                                                                                                                                                                                                                // Load PNG and save it to CMYK JPEG
                                                                                                                                                                                                                                                using (Aspose.Imaging.FileFormats.Png.PngImage image = (Aspose.Imaging.FileFormats.Png.PngImage)Image.Load(dir + "sample.png"))
                                                                                                                                                                                                                                                {
                                                                                                                                                                                                                                                    using (System.IO.Stream rgbProfileStream = System.IO.File.OpenRead(dir + "eciRGB_v2.icc"))
                                                                                                                                                                                                                                                    using (System.IO.Stream cmykProfileStream = System.IO.File.OpenRead(dir + "ISOcoated_v2_FullGamut4.icc"))
                                                                                                                                                                                                                                                    {
                                                                                                                                                                                                                                                        Aspose.Imaging.ImageOptions.JpegOptions saveOptions = new Aspose.Imaging.ImageOptions.JpegOptions();
                                                                                                                                                                                                                                                        saveOptions.ColorType = Aspose.Imaging.FileFormats.Jpeg.JpegCompressionColorMode.Cmyk;

                                                                                                                                                                                                                                                        // Use custom ICC profiles
                                                                                                                                                                                                                                                        saveOptions.RgbColorProfile = new Aspose.Imaging.Sources.StreamSource(rgbProfileStream);
                                                                                                                                                                                                                                                        saveOptions.CmykColorProfile = new Aspose.Imaging.Sources.StreamSource(cmykProfileStream);

                                                                                                                                                                                                                                                        image.Save(dir + "output.cmyk.jpg", saveOptions);
                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                }

                                                                                                                                                                                                                                                // Load CMYK JPEG and save it to PNG
                                                                                                                                                                                                                                                using (Aspose.Imaging.FileFormats.Jpeg.JpegImage image = (Aspose.Imaging.FileFormats.Jpeg.JpegImage)Image.Load(dir + "output.cmyk.jpg"))
                                                                                                                                                                                                                                                {
                                                                                                                                                                                                                                                    using (System.IO.Stream rgbProfileStream = System.IO.File.OpenRead(dir + "eciRGB_v2.icc"))
                                                                                                                                                                                                                                                    using (System.IO.Stream cmykProfileStream = System.IO.File.OpenRead(dir + "ISOcoated_v2_FullGamut4.icc"))
                                                                                                                                                                                                                                                    {
                                                                                                                                                                                                                                                        // Use custom ICC profiles
                                                                                                                                                                                                                                                        image.RgbColorProfile = new Aspose.Imaging.Sources.StreamSource(rgbProfileStream);
                                                                                                                                                                                                                                                        image.CmykColorProfile = new Aspose.Imaging.Sources.StreamSource(cmykProfileStream);

                                                                                                                                                                                                                                                        Aspose.Imaging.ImageOptions.PngOptions saveOptions = new Aspose.Imaging.ImageOptions.PngOptions();
                                                                                                                                                                                                                                                        image.Save(dir + "output.rgb.png", saveOptions);
                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                }

VerticalResolution

Właściwość ta zarządza rozdzielczością pionową, wyrażoną w pikselach na cala, dlapowiązane Aspose.Imaging.RasterImage. dostosowanie tej rozdzielczości wpływa naRozmiar i jakość obrazu, gdy jest drukowany lub wyświetlany w stałym rozmiarze fizycznym.Po ustawieniu tej właściwości kontrolujesz, jak gęsto są pakowane piksele obrazu.Vertikalnie, wpływając na jego ogólną ostrość i jasność.

public override double VerticalResolution { get; set; }

Wartość nieruchomości

double

Examples

Poniższy przykład pokazuje, jak ustawić rozdzielczość horyzontalną / pionową obrazu JPEG.

string dir = "c:\\temp\\";

                                                                                                 using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.jpg"))
                                                                                                 {
                                                                                                     Aspose.Imaging.FileFormats.Jpeg.JpegImage jpegImage = (Aspose.Imaging.FileFormats.Jpeg.JpegImage)image;

                                                                                                     // Get horizontal and vertical resolution of the BmpImage
                                                                                                     double horizontalResolution = jpegImage.HorizontalResolution;
                                                                                                     double verticalResolution = jpegImage.VerticalResolution;
                                                                                                     System.Console.WriteLine("The horizontal resolution, in pixels per inch: {0}", horizontalResolution);
                                                                                                     System.Console.WriteLine("The vertical resolution, in pixels per inch: {0}", verticalResolution);

                                                                                                     if (horizontalResolution != 96.0 || verticalResolution != 96.0)
                                                                                                     {
                                                                                                         // Use the SetResolution method for updating both resolution values in a single call.
                                                                                                         System.Console.WriteLine("Set resolution values to 96 dpi");
                                                                                                         jpegImage.SetResolution(96.0, 96.0);

                                                                                                         System.Console.WriteLine("The horizontal resolution, in pixels per inch: {0}", jpegImage.HorizontalResolution);
                                                                                                         System.Console.WriteLine("The vertical resolution, in pixels per inch: {0}", jpegImage.VerticalResolution);
                                                                                                     }

                                                                                                     // The output may look like this:
                                                                                                     // The horizontal resolution, in pixels per inch: 300
                                                                                                     // The vertical resolution, in pixels per inch: 300
                                                                                                     // Set resolution values to 96 dpi
                                                                                                     // The horizontal resolution, in pixels per inch: 96
                                                                                                     // The vertical resolution, in pixels per inch: 96
                                                                                                 }

Remarks

Zazwyczaj wartość ta jest zawsze 72, ponieważ różne platformy nie mogą zwrócić rozdzielczości ekranu. Możesz rozważyć użycie metody SetResolution, aby zaktualizować oba wartości rozliczenia w jednym wezwaniu.

Width

Ta właściwość odzyskuje szerokość obrazu, wyrażoną w pikselach.niezbędne informacje o wymiarach obrazu, umożliwiające dokładne renderowanie,manipulacja lub wyświetlanie danych obrazu.

public override int Width { get; }

Wartość nieruchomości

int

XmpData

otrzymuje lub ustawia metadane XMP, umożliwiając bezprzewodową integracjęinformacje opisowe do pliku obrazu. czy wyodrębniasz istniejący XMPmetadane lub ich aktualizacja z nowymi informacjami, to właściwość ułatwiazarządzanie rozszerzonymi metadatami, zapewniając kompatybilność z różnymi aplikacjamii przepływów pracy.

public override XmpPacketWrapper XmpData { get; set; }

Wartość nieruchomości

XmpPacketWrapper

Methods

AutoRotate()

Automatycznie obraca obraz w oparciu o dane orientacyjne pobrane z ExifMetoda ta zapewnia, że obrazy są wyświetlane w prawidłowej orientacji,poprawa doświadczenia użytkownika i wyeliminowanie potrzeby ręcznych dostosowania.analizując informacje Exif, obraz jest rotujowany zgodnie z tym, zapewniając bezprzewodowydoświadczenie przeglądania na różnych platformach i urządzeniach. ta automatyczna rotacjaproces ułatwia obsługę obrazu i poprawia ogólną użyteczność, zwłaszcza gdyzajmować się dużym zestawem obrazów z różnymi orientacjami.

public void AutoRotate()

Exceptions

ArgumentOutOfRangeException

Wartość „Orientacja” „JpegExifData” jest poza dopuszczonym zakresem [1…8], więc nie można stosować automatycznej rotacji.

GetModifyDate(Bool)

Odtwarza datę i czas, w którym obraz zasobowy przeszedł swój najnowszyMetoda ta dostarcza cennych metadanych, umożliwiając użytkownikom śledzenie iskutecznie zarządzać aktualizacjami do pliku obrazu. poprzez dostęp do tych informacji, użytkownicymoże zapewnić integralność i walutę ich aktywów obrazowych, ułatwiającpodejmowanie decyzji dotyczących wykorzystania i konserwacji obrazu.

public override DateTime GetModifyDate(bool useDefault)

Parameters

useDefault bool

Jeśli ustawione na “prawdziwe”, użyj informacji z FileInfo jako wartości domyślnej.

Returns

DateTime

Data i czas ostatniej modyfikacji obrazu zasobów.

ReleaseManagedResources()

Upewnij się, że nie zarządzane zasoby nie są tutaj uwalniane, ponieważ mogą być już uwalniane.

protected override void ReleaseManagedResources()

RemoveMetadata()

Usunąć te metadane przykładu obrazu poprzez ustawienie tych wartości Aspose.Imaging.Xmp.IHasXMPData.xmpDate i Wl17.Exif.IHasexifDato. zero.

public override void RemoveMetadata()

SaveData(Stream)

Oszczędzaj dane.

protected override void SaveData(Stream stream)

Parameters

stream Stream

Przepływ do przechowywania danych do.

SetResolution(podwójne, podwójne)

ustanawia rozdzielczość dla określonego Aspose.Imaging.RasterImage, zapewniającdokładne możliwości skalowania i drukowania. ta metoda umożliwia użytkownikom dostosowanierozdzielczość obrazu, aby spełniać ich specyficzne wymagania, zarówno w przypadku cyfrowychwyświetlanie lub odtwarzanie fizyczne. poprzez ustawienie rozdzielczości, użytkownicy mogą zoptymalizowaćjakość obrazu i zapewnienie kompatybilności z różnymi urządzeniami wyjściowymi i mediami,Poprawa ogólnego doświadczenia wizualnego i użyteczności obrazu.

public override void SetResolution(double dpiX, double dpiY)

Parameters

dpiX double

Rozdzielczość horyzontalna, w punktach na cala, Aspose.Imaging.RasterImage.

dpiY double

Rozdzielczość pionowa, w punktach na cala, Aspose.Imaging.RasterImage.

Examples

Poniższy przykład pokazuje, jak ustawić rozdzielczość horyzontalną / pionową obrazu JPEG.

string dir = "c:\\temp\\";

                                                                                                 using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.jpg"))
                                                                                                 {
                                                                                                     Aspose.Imaging.FileFormats.Jpeg.JpegImage jpegImage = (Aspose.Imaging.FileFormats.Jpeg.JpegImage)image;

                                                                                                     // Get horizontal and vertical resolution of the BmpImage
                                                                                                     double horizontalResolution = jpegImage.HorizontalResolution;
                                                                                                     double verticalResolution = jpegImage.VerticalResolution;
                                                                                                     System.Console.WriteLine("The horizontal resolution, in pixels per inch: {0}", horizontalResolution);
                                                                                                     System.Console.WriteLine("The vertical resolution, in pixels per inch: {0}", verticalResolution);

                                                                                                     if (horizontalResolution != 96.0 || verticalResolution != 96.0)
                                                                                                     {
                                                                                                         // Use the SetResolution method for updating both resolution values in a single call.
                                                                                                         System.Console.WriteLine("Set resolution values to 96 dpi");
                                                                                                         jpegImage.SetResolution(96.0, 96.0);

                                                                                                         System.Console.WriteLine("The horizontal resolution, in pixels per inch: {0}", jpegImage.HorizontalResolution);
                                                                                                         System.Console.WriteLine("The vertical resolution, in pixels per inch: {0}", jpegImage.VerticalResolution);
                                                                                                     }

                                                                                                     // The output may look like this:
                                                                                                     // The horizontal resolution, in pixels per inch: 300
                                                                                                     // The vertical resolution, in pixels per inch: 300
                                                                                                     // Set resolution values to 96 dpi
                                                                                                     // The horizontal resolution, in pixels per inch: 96
                                                                                                     // The vertical resolution, in pixels per inch: 96
                                                                                                 }

UpdateDimensions(i int, int)

Aktualizacja wymiarów obrazu.

protected override void UpdateDimensions(int newWidth, int newHeight)

Parameters

newWidth int

Nowy widok obrazu.

newHeight int

Nowa wysokość obrazu.

UpdateMetadata()

Aktualizacja metadatu obrazu.

protected override void UpdateMetadata()
 Polski