Class JpegImage

Class JpegImage

Pôvodný názov: Aspose.Imaging.FileFormats.Jpeg Zhromaždenie: Aspose.Imaging.dll (25.4.0)

Efektívne manipulovať JPEG raster obrázky s našou API, ponúkajúce podporupre rôzne farebné profily ako RGB a CMYK, prispôsobiteľné bity na pixelRozlíšenie a spracovanie kontajnerov EXIF, JFIF a XMP metadata.Vychutnajte si automatizovanú otáčanie na základe orientačných údajov a vyberte si z rôznychúrovne kompresie vrátane JPEG bez straty, aby sa dosiahla optimálna kvalita obrazua súbor veľkosti rovnováhy pre vaše projekty.

[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

Z dedičných členov

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

Prístup k poznámkam výrobcu fotoaparátu v obrázku 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);
                                                                    }
                                                                }

Príklad ukazuje, ako nahrať JpegImage z súboru.

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(Stretnutie)

Klasa Aspose.Imaging.FileFormats.Jpeg.JPEGImage sa bez námahy iniciuje tým, že vyvoláva svojukonštruktor s špecifikovaným parametrom cesty. Tento konštruktér umožňuje bezchybnévytvorenie JPEG obrázkov, ktoré zabezpečujú rýchlu integráciu do vašich projektov s ľahkosťou.

public JpegImage(string path)

Parameters

path string

Cesta na nahrávanie obrazu z a inicializovať pixelové a paletové údaje s.

Examples

Príklad ukazuje, ako nahrať JpegImage z súboru.

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)

Initializujte objekt s obrázkom JPEG pomocou triedy Aspose.Imaging.FileFormats.Jpeg.Tento konštruktor zjednodušuje proces práce s JPEGobrázky, ktoré ponúkajú jednoduchý prístup k ich začleneniu do vašich projektovbez námahy .

public JpegImage(Stream stream)

Parameters

stream Stream

Stream na nahrávanie obrazu z a inicializovať pixelové a paletové údaje s.

Examples

Príklad ukazuje, ako nahrať JpegImage z prúdu súborov.

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)

Začiarknite novú inštanciu triedy Aspose.Imaging.FileFormats.Jpeg.JPEG s rasterovým obrázkomTento konštruktor poskytuje pohodlný spôsob, ako vytvoriť JPEG obrázkypriamo z rasterových obrázkov, zjednodušenie pracovného toku pre prácu s JPEG obrázkamivo vašich aplikáciách.

public JpegImage(RasterImage rasterImage)

Parameters

rasterImage RasterImage

Obrázok na inicializáciu pixelov a dátové palety s.

Examples

Príklad ukazuje, ako nahrať JpegImage z iného 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(a int, int)

Vytvorte novú inštanciu triedy Aspose.Imaging.FileFormats.Jpeg.Zobraziť obrázok so špecifikovanou šírkoua parametre výšky. Tento konštruktor umožňuje vytvoriť JPEG obrázky sprispôsobené rozmery, ktoré vám poskytujú flexibilitu pri riadení veľkostí obrazu vo vašej aplikácii.

public JpegImage(int width, int height)

Parameters

width int

Rozsah obrazu je široký.

height int

Výška obrazu.

Examples

Nasledujúci príklad ukazuje, ako vytvoriť JPEG obrázok špecifikovanej veľkosti.

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

Nasledujúci príklad nahráva BMP obrázok a uloží ho do JPEG pomocou rôznych možností ušetrenia.

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(Spoločnosť JpegOptions, int)

Začiarknite nový objekt Aspose.Imaging.FileFormats.Jpeg.Zobraziť obrázok s ponúkanými možnosťami JPEG.Tento konštruktor vám umožní prispôsobiť rôzne nastavenia pre obrázok JPEG, ako napríkladako úroveň kompresie, kvalita a dodatočné parametre, ktoré poskytujú presnú kontrolunad výsledným formátom obrazu.

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

Parameters

jpegOptions JpegOptions

Možnosti pre JPEG.

width int

Šírka obrazu .

height int

Výška obrazu .

Examples

Nasledujúci príklad nahráva BMP obrázok a uloží ho do JPEG pomocou rôznych možností ušetrenia.

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

Nasledujúci príklad ukazuje, ako vytvoriť JPEG obrázok špecifickej veľkosti s špecifikovanými parametrami.

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

Obnoviť hĺbku pixelov obrazu bez námahy s touto vlastnosťou, ponúkavnímanie bohatstva farby alebo šedej reprezentácie. či je toživá fotografia alebo monochrómová ilustrácia, táto vlastnosť poskytuje kľúčovéinformácie o vizuálnej zložitosti obrazu.

public override int BitsPerPixel { get; }

Hodnota nehnuteľnosti

int

CmykColorProfile

Farebný profil CMYK spojený s obrázkami CMYK a YCCK JPEG zaisťuje presnosťfarebná konverzia a vernosť. funguje v spojení s RGBColorProfile nazaručuje presnú farebnú reprezentáciu v rôznych zariadeniach a aplikáciách.Táto dvojica je kľúčová pre udržanie konzistencie v farebnom renderovaní adosiahnutie optimálnej kvality obrazu.

public StreamSource CmykColorProfile { get; set; }

Hodnota nehnuteľnosti

StreamSource

Examples

Nasledujúci príklad nahráva PNG a ušetrí ho do CMYK JPEG pomocou prispôsobeného profilu ICC. Potom nahrádza CMYK JPG a ukladá ho späť do pNG. Konverzia farieb z RGB na CMYN a z CMYL na RMB sa vykonáva pomocou personalizovaných profíl Icc.

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

Spravovať komentáre súboru JPEG s touto vlastnosťou, čo vám umožní pridať alebo získaťopisné poznámky spojené s obrázkom. či je označovanie obrázkov smetadata alebo rozšírením dodatočného kontextu, táto vlastnosť poskytuje flexibilitu vorganizovať a kategorizovať vaše JPEG súbory.

public string Comment { get; set; }

Hodnota nehnuteľnosti

string

DestinationCmykColorProfile

Farebný profil CMYK je životne dôležitý pre presnú farebnú konverziu CMYK a YCCK.JPEG snímky počas procesu úspory. funguje v tandeme s RGBColorProfilezabezpečiť správnu farebnú reprezentáciu, udržať konzistenciu a kvalitu medzirôzne zariadenia a softvér. táto synchronizácia je kľúčová pre dosiahnutiepresné a spoľahlivé farebné renderovanie v posledných uložených snímkach.

public StreamSource DestinationCmykColorProfile { get; set; }

Hodnota nehnuteľnosti

StreamSource

DestinationRgbColorProfile

RGBColorProfile je nevyhnutný pre presnú farebnú konverziu CMYK a YCCKJPEG snímky počas procesu úspory. pri páre s CMYKColorProfile,Uistite sa, že farby sú správne odrážané a udržiava konzistenciu medzirôzne zariadenia a aplikácie. táto kombinácia je kľúčová pre zachovanieurčená farebná reprezentácia a dosiahnutie vysoko kvalitného výstupu obrazu.

public StreamSource DestinationRgbColorProfile { get; set; }

Hodnota nehnuteľnosti

StreamSource

ExifData

Správa údajov EXIF s touto vlastnosťou, ktorá vám umožní pridať alebo získať metadatasúvisí s obrázkom. či je to extrahovanie informácií o fotoaparátenastavenia alebo úpravy existujúcich metadata, táto vlastnosť ponúka flexibilitu vSpráva kontajnera údajov EXIF.

public JpegExifData ExifData { get; set; }

Hodnota nehnuteľnosti

JpegExifData

Examples

Nasledujúci príklad ukazuje, ako extrahovať značky 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

Obnoviť formát obrazu bez námahy s touto vlastnosťou.cenný vklad do formátu súborov, pomáha pri bezchybnej integrácii aKontrola kompatibility v rôznych platformách a aplikáciách.

public override FileFormat FileFormat { get; }

Hodnota nehnuteľnosti

FileFormat

Height

Získajte výšku obrazu bez námahy s touto vlastnosťou.prístup k vertikálnemu rozmeru obrazu, čo vám umožní efektívneurčiť pomer veľkosti a aspektov bez potreby komplexných výpočtov aleboĎalšie metódy .

public override int Height { get; }

Hodnota nehnuteľnosti

int

HorizontalResolution

Táto nehnuteľnosť vám umožňuje prístup k horizontálnemu rozlíšeniuAspose.Imaging.RasterImage, merané v pixeloch na palec.Táto hodnota, môžete presne ovládať rozlíšenie obrazu, zabezpečiť hospĺňa vaše špecifické požiadavky na kvalitu a jasnosť.

public override double HorizontalResolution { get; set; }

Hodnota nehnuteľnosti

double

Examples

Nasledujúci príklad ukazuje, ako nastaviť horizontálne/vertikálne rozlíšenie 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

V predvolenom nastavení je táto hodnota vždy 96 pretože rôzne platformy nemôžu vrátiť rozlíšenie obrazovky.Môžete zvážiť použitie metódy SetResolution na aktualizáciu oboch hodnôt rozlíšenia v jednom volaní.

IgnoreEmbeddedColorProfile

Zrušiť alebo zmeniť vlajku označujúce, či je vstavaný farebný profilNastavením tejto vlajky môžu používatelia určiť, či je predvolená farbaprofil by sa mal používať namiesto vstavaného. táto možnosť zaručuje väčšíkontrola riadenia farieb, uľahčovanie úprav konzistencie akompatibilita na rôznych platformách a aplikáciách.

public bool IgnoreEmbeddedColorProfile { get; set; }

Hodnota nehnuteľnosti

bool

Jfif

Táto vlastnosť vám umožňuje prístup alebo úpravu JFIF (JPEG File Interchange)Formát) údaje súvisiace s obrazom JPEG. JFIF je štandardný formát prevýmena JPEG-komprimovaných obrázkov medzi počítačmi a inými zariadeniami.alebo nastavenie tejto vlastnosti, môžete interagovať s údajmi JFIF, ktoré môžu zahŕňaťinformácie, ako je rozlíšenie obrazu, pomer aspektov a miniatúra.

public JFIFData Jfif { get; set; }

Hodnota nehnuteľnosti

JFIFData

JpegOptions

Získajte prístup k možnostiam JPEG používaným pri vytváraní alebo načítaní tohtoAspose.Imaging.FileFormats.Jpeg.Zobraziť príklad s ľahkosťou.Táto nehnuteľnosť ponúka cenné detailyo špecifických nastaveniach používaných, ktoré umožňujú používateľom pochopiť a replikovaťspracovanie obrazu pracovných tokov efektívne. či je to úrovne kompresie, kvalitanastavenia, alebo iné parametre, táto vlastnosť poskytuje základné poznatky oBezproblémová manipulácia s obrazom.

public JpegOptions JpegOptions { get; }

Hodnota nehnuteľnosti

JpegOptions

Examples

Nasledujúci príklad ukazuje, ako extrahovať informácie o hlavičke 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

Táto vlastnosť získava surový dátový formát obrazu, ktorý ukazuje, akoobrazové údaje sú štruktúrované a kódované. porozumieť formátu surových údajov jeje nevyhnutné na účely efektívneho spracovania alebo manipulácie s údajmi o obraze.vnímanie základnej reprezentácie obrazu, ako je napríklad, či jekomprimované, kódované v určitom farebnom priestore alebo uložené v konkrétnom súborePrístup k tejto nehnuteľnosti vám umožňuje získať cenné informácie oštruktúra údajov obrazu, ktorá vám umožní vykonávať rôzne operácie alebo optimalizácieprispôsobený svojmu špecifickému formátu.

public override PixelDataFormat RawDataFormat { get; }

Hodnota nehnuteľnosti

PixelDataFormat

RgbColorProfile

Farebný profil RGB pre obrázky CMYK a YCCK JPEG zaručuje presnú farbukonverzia a reprezentácia. musí byť prepojený s CMYKColorProfile nazachovať konzistenciu a vernosť v farebnom renderovaní. táto dvojica je nevyhnutná preaplikácie, ktoré vyžadujú presné farebné riadenie a reprodukciu obrázkov,Uistite sa, že údaje RGB sú správne interpretované a zobrazované.

public StreamSource RgbColorProfile { get; set; }

Hodnota nehnuteľnosti

StreamSource

Examples

Nasledujúci príklad nahráva PNG a ušetrí ho do CMYK JPEG pomocou prispôsobeného profilu ICC. Potom nahrádza CMYK JPG a ukladá ho späť do pNG. Konverzia farieb z RGB na CMYN a z CMYL na RMB sa vykonáva pomocou personalizovaných profíl Icc.

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

Táto vlastnosť spravuje vertikálne rozlíšenie, vyjadrené v pixeloch na palec, presúvisiaci Aspose.Imaging.RasterImage. prispôsobenie tejto rozlíšenia ovplyvňujeVeľkosť a kvalita obrazu pri vytlačení alebo zobrazovaní v pevnej fyzickej veľkosti.Nastavením tejto vlastnosti kontrolujete hustotu balenia pixelov obrazu.vertikálne, ovplyvňujúce jeho celkovú ostrosť a jasnosť.

public override double VerticalResolution { get; set; }

Hodnota nehnuteľnosti

double

Examples

Nasledujúci príklad ukazuje, ako nastaviť horizontálne/vertikálne rozlíšenie 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

Upozorňujeme predvolene, že táto hodnota je vždy 72 pretože rôzne platformy nemôžu vrátiť rozlíšenie obrazovky.Môžete zvážiť použitie metódy SetResolution na aktualizáciu oboch hodnôt rozlišenia v jednom volaní.

Width

Táto vlastnosť získava šírku obrazu, vyjadrenú v pixeloch.základné informácie o rozmeroch obrazu, ktoré umožňujú presné renderovanie,manipulácia, alebo zobrazenie obrazových údajov.

public override int Width { get; }

Hodnota nehnuteľnosti

int

XmpData

Získava alebo nastaví metadata XMP, ktoré umožňujú bezchybnú integráciuopisné informácie do obrázkového súboru. či extrahujete existujúci XMPmetadata alebo aktualizácia s novými informáciami, táto vlastnosť zjednodušujeriadenie rozšírených metadata, zabezpečenie kompatibility s rôznymi aplikáciamia pracovných tokov.

public override XmpPacketWrapper XmpData { get; set; }

Hodnota nehnuteľnosti

XmpPacketWrapper

Methods

AutoRotate()

Automaticky otáča obrázok na základe orientačných údajov vytiahnutých z Exifmetadata. táto metóda zabezpečuje, že obrázky sú zobrazené v správnej orientácii,zlepšenie užívateľskej skúsenosti a odstránenie potreby manuálnych úprav.analyzovať informácie o Exif, obraz je rotujúci v súlade s tým, čo poskytuje bezdrôtovýzobrazenie skúseností cez rôzne platformy a zariadenia. toto automatizované otáčanieproces zjednodušuje spracovanie obrazu a zlepšuje celkovú použiteľnosť, najmä akZaoberajú sa veľkými balíčkami obrázkov s rôznymi orientáciami.

public void AutoRotate()

Exceptions

ArgumentOutOfRangeException

“Orientácia” hodnota “JpegExifData” je mimo povoleného rozsahu [1…8], takže automatické otáčanie nie je možné aplikovať.

GetModifyDate(bool)

Vráti dátum a čas, kedy zdrojový obrázok prešiel svojou najnovšouTáto metóda poskytuje cenné metaúdaje, ktoré používateľom umožňujú sledovať asprávu aktualizácií do obrázkového súboru efektívne. prístupom k týmto informáciám, používateliamôže zabezpečiť integritu a menovú hodnotu ich imidžových aktív, uľahčujú informovanúrozhodovanie o používaní a údržbe obrazu.

public override DateTime GetModifyDate(bool useDefault)

Parameters

useDefault bool

Ak je nastavený na “skutočný”, použite informácie z programu FileInfo ako predvolenú hodnotu.

Returns

DateTime

Dátum a čas, kedy bol obrázok zdroja naposledy upravený.

ReleaseManagedResources()

Uvoľní spravované zdroje. uistite sa, že tu nie sú spravované zdroje uvoľnené, pretože možno už boli uvoľnené.

protected override void ReleaseManagedResources()

RemoveMetadata()

Odstrániť tento obrázok príklad metadata tým, že nastaviť tieto hodnoty Aspose.Imaging.Xmp.IHasXmpData.xmpDate a Wl17.Exif.IhasexifDato. nula.

public override void RemoveMetadata()

SaveData(Stream)

Šetrí sa dáta.

protected override void SaveData(Stream stream)

Parameters

stream Stream

Stream na ukladanie údajov.

SetResolution(dvojnásobný, dvojnásobný)

Nastaví rozlíšenie pre špecifikovaný Aspose.Imaging.RasterImage, zabezpečujepresné kapacity skalovania a tlače. Táto metóda umožňuje používateľom prispôsobiť sarozlíšenie obrazu, aby zodpovedalo ich špecifickým požiadavkám, či už digitálnezobrazenie alebo fyzická reprodukcia. nastavením rozlíšenia môžu používatelia optimalizovaťkvalita obrazu a zabezpečenie kompatibility s rôznymi výstupnými zariadeniami a médiami,zlepšenie celkovej vizuálnej skúsenosti a použiteľnosti obrazu.

public override void SetResolution(double dpiX, double dpiY)

Parameters

dpiX double

Horizontálna rozlíšenie, v bodoch na palec, Aspose.Imaging.RasterImage.

dpiY double

Vertikálna rozlíšenie, v bodoch na palec, Aspose.Imaging.RasterImage.

Examples

Nasledujúci príklad ukazuje, ako nastaviť horizontálne/vertikálne rozlíšenie 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(a int, int)

Aktualizujte rozmery obrazu.

protected override void UpdateDimensions(int newWidth, int newHeight)

Parameters

newWidth int

Nový obrázok šírka.

newHeight int

Nová výška obrazu.

UpdateMetadata()

Aktualizácia obrazu metadata.

protected override void UpdateMetadata()
 Slovenčina