Class WebPImage

Class WebPImage

Tên không gian: Aspose.Imaging.FileFormats.Webp Tổng hợp: Aspose.Imaging.dll (25.4.0)

Điều khiển hình ảnh webp raster với API của chúng tôi, sử dụng các tính năng hiện đại của nó cho cả haigiảm và giảm bớt nén, đảm bảo chất lượng hình ảnh tối ưu với kích thước tệp giảm.Kiên nhẫn xử lý các định dạng tệp mở rộng, hoạt hình và các kênh alpha, trong khi dễ dàngcập nhật kích thước, khôi phục một cách tương đối, đào, xoay, áp dụng bộ lọc,điều chỉnh các thông số hình ảnh, và chuyển đổi sang các định dạng ảnh khác để đa dạngTối ưu hóa hình ảnh web.

[JsonObject(MemberSerialization.OptIn)]
public sealed class WebPImage : RasterCachedMultipageImage, IDisposable, IObjectWithBounds, IRasterImageArgb32PixelLoader, IRasterImageRawDataLoader, IHasXmpData, IHasMetadata, IMultipageImageExt, IMultipageImage

Inheritance

object DisposableObject DataStreamSupporter Image RasterImage RasterCachedImage RasterCachedMultipageImage WebPImage

Implements

IDisposable , IObjectWithBounds , IRasterImageArgb32PixelLoader , IRasterImageRawDataLoader , IHasXmpData , IHasMetadata , IMultipageImageExt , IMultipageImage

Thành viên thừa kế

RasterCachedMultipageImage.AdjustBrightness(int) , RasterCachedMultipageImage.AdjustContrast(float) , RasterCachedMultipageImage.AdjustGamma(float, float, float) , RasterCachedMultipageImage.AdjustGamma(float) , RasterCachedMultipageImage.Blend(Point, RasterImage, Rectangle, byte) , RasterCachedMultipageImage.BinarizeFixed(byte) , RasterCachedMultipageImage.BinarizeBradley(double, int) , RasterCachedMultipageImage.BinarizeBradley(double) , RasterCachedMultipageImage.BinarizeOtsu() , RasterCachedMultipageImage.Crop(Rectangle) , RasterCachedMultipageImage.Crop(int, int, int, int) , RasterCachedMultipageImage.Dither(DitheringMethod, int, IColorPalette) , RasterCachedMultipageImage.Grayscale() , RasterCachedMultipageImage.NormalizeHistogram() , RasterCachedMultipageImage.Rotate(float, bool, Color) , RasterCachedMultipageImage.RotateFlip(RotateFlipType) , RasterCachedMultipageImage.RotateFlipAll(RotateFlipType) , RasterCachedMultipageImage.Resize(int, int, ResizeType) , RasterCachedMultipageImage.Resize(int, int, ImageResizeSettings) , RasterCachedMultipageImage.ResizeWidthProportionally(int, ResizeType) , RasterCachedMultipageImage.ResizeHeightProportionally(int, ResizeType) , RasterCachedMultipageImage.ReplaceColor(int, byte, int) , RasterCachedMultipageImage.ReplaceNonTransparentColors(int) , RasterCachedMultipageImage.Filter(Rectangle, FilterOptionsBase) , RasterCachedMultipageImage.NormalizeAngle(bool, Color) , RasterCachedMultipageImage.CacheData() , RasterCachedMultipageImage.GetSerializedStream(ImageOptionsBase, Rectangle, out int) , RasterCachedMultipageImage.Height , RasterCachedMultipageImage.Width , RasterCachedMultipageImage.BitsPerPixel , RasterCachedMultipageImage.IsCached , RasterCachedMultipageImage.PageCount , RasterCachedMultipageImage.Pages , RasterCachedMultipageImage.HasAlpha , RasterCachedMultipageImage.HasTransparentColor , RasterCachedMultipageImage.ImageOpacity , RasterCachedMultipageImage.BackgroundColor , RasterCachedMultipageImage.XmpData , RasterCachedMultipageImage.PageExportingAction , 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

Ví dụ này cho thấy làm thế nào để tải một hình ảnh WebP từ một tệp và lưu nó vào PNG.

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

                                                                                      // Load a WebP image from a file.
                                                                                      using (Aspose.Imaging.FileFormats.Webp.WebPImage webPImage = new Aspose.Imaging.FileFormats.Webp.WebPImage(dir + "test.webp"))
                                                                                      {
                                                                                          // Save to PNG
                                                                                          // Note that only the active frame will be stored to PNG, since PNG is not a multi-page format.
                                                                                          webPImage.Save(dir + "test.output.png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                                      }

Constructors

Web hình ảnh(Stream)

Khởi động một trường hợp mới của lớp Aspose.Imaging.FileFormats.Webp. WebPImage, khởi độngtừ một nguồn dòng được cung cấp. Sử dụng nhà xây dựng này để tạo WebPCác đối tượng hình ảnh trực tiếp từ dòng chảy, cho phép xử lý và thao tác hiệu quảDữ liệu hình ảnh WebP trong ứng dụng của bạn.

public WebPImage(Stream stream)

Parameters

stream Stream

Hình ảnh Stream WebP

Examples

Ví dụ này cho thấy làm thế nào để tải một hình ảnh WebP từ một dòng tệp và lưu nó vào PNG.

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

                                                                                             // Load a WebP image from a file stream.
                                                                                             using (System.IO.Stream stream = System.IO.File.OpenRead(dir + "test.webp"))
                                                                                             using (Aspose.Imaging.FileFormats.Webp.WebPImage webPImage = new Aspose.Imaging.FileFormats.Webp.WebPImage(stream))
                                                                                             {
                                                                                                 // Save to PNG
                                                                                                 // Note that only the active frame will be stored to PNG, since PNG is not a multi-page format.
                                                                                                 webPImage.Save(dir + "test.output.png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                                             }

Web hình ảnh(LoadOptions, LoadOptions)

Tạo một ví dụ mới của lớp Aspose.Imaging.FileFormats.Webp. WebPImage bằng cách sử dụng một dòng vàtùy chọn tải cụ thể, giúp xử lý đa dạng dữ liệu hình ảnh WebP.Tham gia nhà xây dựng này để bắt đầu không ngừng các đối tượng ảnh WebP từdòng trong khi tùy chỉnh các thông số tải như cần thiết trong ứng dụng của bạn.

public WebPImage(Stream stream, LoadOptions loadOptions)

Parameters

stream Stream

Hình ảnh Stream WebP

loadOptions LoadOptions

Các tùy chọn tải.

Web hình ảnh(String)

Khởi động một ví dụ mới của lớp Aspose.Imaging.FileFormats.Webp. WebPImage, bắt đầutừ một nguồn tệp được cung cấp. Sử dụng nhà xây dựng này để tạo WebPhình ảnh đối tượng trực tiếp từ các tập tin, làm nhanh quá trình tải vàthao tác dữ liệu hình ảnh WebP trong ứng dụng của bạn.

public WebPImage(string path)

Parameters

path string

Hướng dẫn cài đặt WebP Image

Examples

Ví dụ này cho thấy làm thế nào để tải một hình ảnh WebP từ một tệp và lưu nó vào PNG.

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

                                                                                      // Load a WebP image from a file.
                                                                                      using (Aspose.Imaging.FileFormats.Webp.WebPImage webPImage = new Aspose.Imaging.FileFormats.Webp.WebPImage(dir + "test.webp"))
                                                                                      {
                                                                                          // Save to PNG
                                                                                          // Note that only the active frame will be stored to PNG, since PNG is not a multi-page format.
                                                                                          webPImage.Save(dir + "test.output.png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                                      }

Web hình ảnh(LoadOptions, LoadOptions)

Tạo một ví dụ mới của lớp Aspose.Imaging.FileFormats.Webp. WebPImage bằng cách sử dụng một tệp vàtùy chọn tải cụ thể, giúp xử lý linh hoạt dữ liệu hình ảnh WebP.nhà xây dựng này để bắt đầu không ngừng các đối tượng hình ảnh WebP từ các tệp trong khitùy chỉnh các thông số tải theo yêu cầu của ứng dụng của bạn.

public WebPImage(string path, LoadOptions loadOptions)

Parameters

path string

Hướng dẫn cài đặt WebP Image

loadOptions LoadOptions

Các tùy chọn tải.

Web hình ảnh(RasterImage)

Khởi động một trường hợp mới của lớp Aspose.Imaging.FileFormats.Webp. WebPImage, khởi độngtừ một cung cấp rasterImage đối tượng. nhà xây dựng này cho phép không có dấu hiệuchuyển đổi hình ảnh raster sang định dạng WebP, cho phép xử lý hiệu quả vàthao tác dữ liệu hình ảnh trong ứng dụng của bạn.

public WebPImage(RasterImage rasterImage)

Parameters

rasterImage RasterImage

Hình ảnh Raster

Examples

Ví dụ này cho thấy làm thế nào để tạo một hình ảnh WebP từ ảnh raster khác.

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

                                                                                   // Load a PNG image of 100x100 px.
                                                                                   using (Aspose.Imaging.FileFormats.Png.PngImage pngImage = new Aspose.Imaging.FileFormats.Png.PngImage(100, 100))
                                                                                   {
                                                                                       Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(pngImage);

                                                                                       // Fill the entire image in red.
                                                                                       Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.Red);
                                                                                       graphics.FillRectangle(brush, pngImage.Bounds);

                                                                                       // Create a WebP image based on the PNG image.
                                                                                       using (Aspose.Imaging.FileFormats.Webp.WebPImage webPImage = new Aspose.Imaging.FileFormats.Webp.WebPImage(pngImage))
                                                                                       {
                                                                                           // Save to a WebP file with default options
                                                                                           webPImage.Save(dir + "output.webp", new Aspose.Imaging.ImageOptions.WebPOptions());
                                                                                       }
                                                                                   }

Web hình ảnh(RasterImage và LoadOptions)

Tạo một ví dụ mới của lớp Aspose.Imaging.FileFormats.Webp.webPimage bằng cách sử dụng một đối tượng RasterImage vàtùy chọn tải cụ thể, cho phép xử lý linh hoạt dữ liệu hình ảnh.nhà xây dựng để bắt đầu không ngừng các đối tượng hình ảnh WebP từ các bức ảnh raster trong khitùy chỉnh các thông số tải theo yêu cầu của ứng dụng của bạn.

public WebPImage(RasterImage rasterImage, LoadOptions loadOptions)

Parameters

rasterImage RasterImage

Hình ảnh Raster

loadOptions LoadOptions

Các tùy chọn tải.

Web hình ảnh(int, int và webpoptions)

Khởi động một trường hợp mới của Aspose.Imaging.FileFormats.Webp. WebPImage lớp với một trốnghình ảnh của chiều rộng và chiều cao cụ thể. nhà xây dựng này cho phéptạo hình ảnh WebP trắng, cung cấp nền tảng cho ảnh tiếp theothao tác và tạo nội dung trong ứng dụng của bạn.

public WebPImage(int width, int height, WebPOptions options)

Parameters

width int

Hình ảnh width

height int

Độ cao hình ảnh

options WebPOptions

Các tùy chọn.

Examples

Ví dụ này cho thấy làm thế nào để tạo một hình ảnh WebP với các tùy chọn được chỉ định từ scratch.

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

                                                                                                 Aspose.Imaging.ImageOptions.WebPOptions createOptions = new Aspose.Imaging.ImageOptions.WebPOptions();
                                                                                                 createOptions.Lossless = true;
                                                                                                 createOptions.Quality = 100f;
                                                                                                 //createOptions.Source = new Aspose.Imaging.Sources.FileCreateSource(dir + "output.webp");

                                                                                                 // Create a WebP image of 100x100 px.
                                                                                                 using (Aspose.Imaging.FileFormats.Webp.WebPImage webPImage = new Aspose.Imaging.FileFormats.Webp.WebPImage(100, 100, createOptions))
                                                                                                 {
                                                                                                     Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(webPImage);

                                                                                                     // Fill the entire image in red.
                                                                                                     Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.Red);
                                                                                                     graphics.FillRectangle(brush, webPImage.Bounds);

                                                                                                     // Save to a WebP file
                                                                                                     webPImage.Save(dir + "output.webp");
                                                                                                 }

Ví dụ này cho thấy làm thế nào để tạo một hình ảnh WebP hoạt hình đa khung với các tùy chọn được chỉ định.

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

                                                                                                         Aspose.Imaging.ImageOptions.WebPOptions createOptions = new Aspose.Imaging.ImageOptions.WebPOptions();
                                                                                                         createOptions.Lossless = true;
                                                                                                         createOptions.Quality = 100f;
                                                                                                         createOptions.AnimBackgroundColor = (uint)Aspose.Imaging.Color.Gray.ToArgb();

                                                                                                         // The default frame plus 36 + 36 additional frames.
                                                                                                         createOptions.AnimLoopCount = 36 + 36 + 1;

                                                                                                         // Create a WebP image of 100x100 px.
                                                                                                         using (Aspose.Imaging.FileFormats.Webp.WebPImage webPImage = new Aspose.Imaging.FileFormats.Webp.WebPImage(100, 100, createOptions))
                                                                                                         {
                                                                                                             // The first circle is red
                                                                                                             Aspose.Imaging.Brushes.SolidBrush brush1 = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.Red);

                                                                                                             // The second circle is black
                                                                                                             Aspose.Imaging.Brushes.SolidBrush brush2 = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.Black);

                                                                                                             // Gradually inscrease the angle of the red arc shape.
                                                                                                             for (int angle = 10; angle <= 360; angle += 10)
                                                                                                             {
                                                                                                                 Aspose.Imaging.FileFormats.Webp.WebPFrameBlock block = new Aspose.Imaging.FileFormats.Webp.WebPFrameBlock(100, 100);
                                                                                                                 Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(block);
                                                                                                                 graphics.FillPie(brush1, block.Bounds, 0, angle);

                                                                                                                 webPImage.AddBlock(block);
                                                                                                             }

                                                                                                             // Gradually inscrease the angle of the black arc and wipe out the red arc.
                                                                                                             for (int angle = 10; angle <= 360; angle += 10)
                                                                                                             {
                                                                                                                 Aspose.Imaging.FileFormats.Webp.WebPFrameBlock block = new Aspose.Imaging.FileFormats.Webp.WebPFrameBlock(100, 100);

                                                                                                                 Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(block);
                                                                                                                 graphics.FillPie(brush2, block.Bounds, 0, angle);
                                                                                                                 graphics.FillPie(brush1, block.Bounds, angle, 360 - angle);

                                                                                                                 webPImage.AddBlock(block);
                                                                                                             }

                                                                                                             // Save to a WebP file
                                                                                                             webPImage.Save(dir + "output.webp");
                                                                                                         }

Web hình ảnh(Int, int, WebPOptions, LoadOptions)

Tạo một ví dụ mới của lớp Aspose.Imaging.FileFormats.Webp. WebPImage với một hình ảnh trống và được chỉ địnhtùy chọn tải.Constructor này cho phép để khởi động các hình ảnh WebP vớicác thông số tải tùy chỉnh, cung cấp tính linh hoạt trong việc tạo hình ảnh vàthao túng trong ứng dụng của bạn.

public WebPImage(int width, int height, WebPOptions options, LoadOptions loadOptions)

Parameters

width int

Hình ảnh width

height int

Độ cao hình ảnh

options WebPOptions

Các tùy chọn.

loadOptions LoadOptions

Các tùy chọn tải.

Properties

FileFormat

Truy cập giá trị định dạng tệp liên quan đến hình ảnh, cung cấp thông tinvề định dạng trong đó hình ảnh được lưu trữ. Sử dụng tài sản này để xác địnhđịnh dạng tệp của hình ảnh, tạo điều kiện để kiểm tra sự tương thích vàxử lý định dạng cụ thể trong ứng dụng của bạn.

public override FileFormat FileFormat { get; }

Giá trị bất động sản

FileFormat

HasAlpha

Xác định xem hình ảnh có chứa một kênh alpha, cho thấy sự hiện diện củathông tin minh bạch. Sử dụng tài sản này để xác định xem hình ảnhbao gồm minh bạch, cho phép xử lý và xử lí thích hợp củaCác hoạt động liên quan đến alpha trong ứng dụng của bạn.

public override bool HasAlpha { get; }

Giá trị bất động sản

bool

Examples

Ví dụ sau đây tải một hình ảnh WEBP và in thông tin về định dạng dữ liệu thô và kênh alpha.

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

                                                                                                                   string fileName = dir + "sample.webp";
                                                                                                                   using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(fileName))
                                                                                                                   {
                                                                                                                       Aspose.Imaging.FileFormats.Webp.WebPImage webpImage = (Aspose.Imaging.FileFormats.Webp.WebPImage)image;

                                                                                                                       // If the active TIFF frame has alpha channel, then the entire TIFF image is considered to have alpha channel.
                                                                                                                       System.Console.WriteLine("ImageFile={0}, FileFormat={1}, HasAlpha={2}", fileName, webpImage.RawDataFormat, webpImage.HasAlpha);

                                                                                                                       int i = 0;
                                                                                                                       foreach (Aspose.Imaging.FileFormats.Webp.IFrame frame in webpImage.Blocks)
                                                                                                                       {
                                                                                                                           Aspose.Imaging.FileFormats.Webp.WebPFrameBlock frameBlock = frame as Aspose.Imaging.FileFormats.Webp.WebPFrameBlock;
                                                                                                                           if (frameBlock != null)
                                                                                                                           {
                                                                                                                               System.Console.WriteLine("Frame={0}, FileFormat={1}, HasAlpha={2}", i++, frameBlock.RawDataFormat, frameBlock.HasAlpha);
                                                                                                                           }
                                                                                                                       }
                                                                                                                   }

                                                                                                                   // The output may look like this:
                                                                                                                   // ImageFile=c:\temp\sample.webp, FileFormat=RgbIndexed1Bpp, used channels: 1, HasAlpha=False
                                                                                                                   // Frame=0, FileFormat=RgbIndexed1Bpp, used channels: 1, HasAlpha=False

Options

Khôi phục hoặc sửa đổi các tùy chọn liên quan đến tài sản cụ thể, cho phéptùy chỉnh tốt của hành vi và cài đặt. Sử dụng tài sản này đểtruy cập và thao túng các thông số có thể cấu hình, tạo điều kiện đa dạngkiểm soát và tối ưu hóa trong chức năng của ứng dụng của bạn.

[JsonProperty]
public WebPOptions Options { get; }

Giá trị bất động sản

WebPOptions

PageCount

Đặt lại tổng số trang trong tài liệu cụ thể, tạo điều kiệnhiệu quả điều hướng và quản lý nội dung đa trang. bao gồm điều nàychức năng để cải thiện trải nghiệm người dùng, cho phép truy cập không ngừngcấu trúc tài liệu toàn diện.

public override int PageCount { get; }

Giá trị bất động sản

int

Pages

Truy cập các khối WebP trong hình ảnh, cho phép kiểm tra chi tiết hoặcmanipulation of the underlying block structure. Sử dụng tài sản này để phân tíchhoặc thay đổi các khối cá nhân trong dữ liệu hình ảnh WebP, tạo điều kiện choKỹ thuật xử lý hình ảnh trong ứng dụng của bạn.

public override Image[] Pages { get; }

Giá trị bất động sản

Image [ ]

Methods

AddBlock(IFRAM)

Thêm một khối WebP mới vào hình ảnh, làm giàu nội dung của nó vàtạo điều kiện cho việc thao tác hình ảnh tiên tiến. tích hợp phương pháp này đểnâng cao cấu trúc và độ phức tạp của dữ liệu hình ảnh WebP trongứng dụng, cho phép kiểm soát chính xác và tối ưu hóa rendering hình ảnh.

public void AddBlock(IFrame block)

Parameters

block IFrame

Webp block để thêm.

Examples

Ví dụ này cho thấy làm thế nào để tạo một hình ảnh WebP hoạt hình đa khung với các tùy chọn được chỉ định.

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

                                                                                                         Aspose.Imaging.ImageOptions.WebPOptions createOptions = new Aspose.Imaging.ImageOptions.WebPOptions();
                                                                                                         createOptions.Lossless = true;
                                                                                                         createOptions.Quality = 100f;
                                                                                                         createOptions.AnimBackgroundColor = (uint)Aspose.Imaging.Color.Gray.ToArgb();

                                                                                                         // The default frame plus 36 + 36 additional frames.
                                                                                                         createOptions.AnimLoopCount = 36 + 36 + 1;

                                                                                                         // Create a WebP image of 100x100 px.
                                                                                                         using (Aspose.Imaging.FileFormats.Webp.WebPImage webPImage = new Aspose.Imaging.FileFormats.Webp.WebPImage(100, 100, createOptions))
                                                                                                         {
                                                                                                             // The first circle is red
                                                                                                             Aspose.Imaging.Brushes.SolidBrush brush1 = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.Red);

                                                                                                             // The second circle is black
                                                                                                             Aspose.Imaging.Brushes.SolidBrush brush2 = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.Black);

                                                                                                             // Gradually inscrease the angle of the red arc shape.
                                                                                                             for (int angle = 10; angle <= 360; angle += 10)
                                                                                                             {
                                                                                                                 Aspose.Imaging.FileFormats.Webp.WebPFrameBlock block = new Aspose.Imaging.FileFormats.Webp.WebPFrameBlock(100, 100);
                                                                                                                 Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(block);
                                                                                                                 graphics.FillPie(brush1, block.Bounds, 0, angle);

                                                                                                                 webPImage.AddBlock(block);
                                                                                                             }

                                                                                                             // Gradually inscrease the angle of the black arc and wipe out the red arc.
                                                                                                             for (int angle = 10; angle <= 360; angle += 10)
                                                                                                             {
                                                                                                                 Aspose.Imaging.FileFormats.Webp.WebPFrameBlock block = new Aspose.Imaging.FileFormats.Webp.WebPFrameBlock(100, 100);

                                                                                                                 Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(block);
                                                                                                                 graphics.FillPie(brush2, block.Bounds, 0, angle);
                                                                                                                 graphics.FillPie(brush1, block.Bounds, angle, 360 - angle);

                                                                                                                 webPImage.AddBlock(block);
                                                                                                             }

                                                                                                             // Save to a WebP file
                                                                                                             webPImage.Save(dir + "output.webp");
                                                                                                         }

AddPage(RasterImage)

Thêm một trang mới vào hình ảnh, mở rộng nội dung của nó và hỗ trợ thêmCác yếu tố hình ảnh. tích hợp phương pháp này để tạo điều kiện quản lý trang năng độngtrong ứng dụng của bạn, cho phép việc tạo và mở rộng nhiều trangtài liệu hoặc hình ảnh.

public void AddPage(RasterImage page)

Parameters

page RasterImage

Trang để thêm.

Exceptions

ArgumentNullException

page’ is null.

AdjustBrightness(int)

Thực hiện điều chỉnh brightness’ cho hình ảnh, cho phép themodification của mức độ chiếu sáng tổng thể. Tham gia phương pháp này vào dòng công việc xử lý hình dung của bạn để tăng khả năng hiển thị và cải thiện chất lượng hình dạng trong ứng dụng.

public override void AdjustBrightness(int brightness)

Parameters

brightness int

Giá trị ánh sáng

AdjustContrast(Sông)

Cải thiện sự tương phản của Aspose.Imaging.Image, tăng cườngsự khác biệt giữa các khu vực ánh sáng và bóng tối. tích hợp phương pháp này vào hình ảnh của bạnxử lý dòng công việc để cải thiện độ rõ ràng thị giác và chất lượng hình ảnh tổng thể trongứng dụng của bạn.

public override void AdjustContrast(float contrast)

Parameters

contrast float

Giá trị tương phản (trong phạm vi [-100; 100])

AdjustGamma(Sông)

Ứng dụng chỉnh sửa gamma vào hình ảnh, điều chỉnh cường độ pixel để đạt đượcánh sáng mong muốn và cân bằng màu sắc. Thêm phương pháp này vào hình ảnh của bạnxử lý dòng công việc để nâng cao chất lượng thị giác và cải thiện độ chính xác củasau đó phân tích hoặc hiển thị các nhiệm vụ trong ứng dụng của bạn.

public override void AdjustGamma(float gamma)

Parameters

gamma float

Gamma cho các kênh đỏ, xanh và xanh coefficient

AdjustGamma(float, float và float)

Thực hiện chỉnh sửa gamma trên hình ảnh bằng cách sử dụng các đồng bộ cá nhân cho màu đỏ,các kênh xanh và xanh, cho phép điều chỉnh cân bằng màu sắc phù hợp vàKết hợp phương pháp này vào đường ống xử lý hình ảnh của bạn để đạt đượckiểm soát chính xác về rendering màu sắc và tăng độ trung thành thị giác trongứng dụng .

public override void AdjustGamma(float gammaRed, float gammaGreen, float gammaBlue)

Parameters

gammaRed float

Gamma cho Red Channel Coefficient

gammaGreen float

Gamma cho Green Channel Coefficient

gammaBlue float

Gamma cho Blue Channel Coefficient

BinarizeBradley(Đôi, int)

Ứng dụng nhị phân hóa vào hình ảnh bằng cách sử dụng thuật toán giới hạn thích ứng của Bradleyvới phạm vi hình ảnh toàn diện. phương pháp này tính năng địa phươnggiới hạn dựa trên khu vực của hình ảnh, tăng khả năng thích nghi để thay đổiđiều kiện chiếu sáng và đảm bảo phân khúc vững chắc cho việc xử lý tiếp theoCác nhiệm vụ trong ứng dụng của bạn.

public override void BinarizeBradley(double brightnessDifference, int windowSize)

Parameters

brightnessDifference double

Sự khác biệt độ sáng giữa pixel và trung bình của một s x s cửa sổ của pixelstập trung xung quanh pixel này.

windowSize int

Kích thước của s x s cửa sổ của các pixel tập trung xung quanh pixel này

BinarizeFixed(byte)

Thực hiện nhị phân trên hình ảnh bằng cách sử dụng một giá trị giới hạn được xác định trước, chuyển đổinó vào một hình ảnh nhị phân nơi các pixel được phân loại như trước hoặc nềndựa trên cường độ của chúng so với giới hạn. tích hợp phương pháp này vàodòng công việc xử lý hình ảnh của bạn để tạo điều kiện cho phân khúc và chiết xuất tính năngcác nhiệm vụ, tăng độ chính xác và hiệu quả của phân tích sau đó trongứng dụng .

public override void BinarizeFixed(byte threshold)

Parameters

threshold byte

Giá trị ranh giới: Nếu giá trị màu xám tương ứng của một pixel lớn hơn so với giới hạn, một255 sẽ được phân bổ cho nó, 0 khác.

BinarizeOtsu()

Thực hiện nhị phân trên hình ảnh bằng cách sử dụng phương pháp ranh giới của Otsu, tự độngxác định giá trị giới hạn tối ưu dựa trên histogram của hình ảnh.phương pháp này vào dòng công việc xử lý hình ảnh của bạn để đạt được phân khúc hiệu quảvà tính năng khai thác, tăng độ chính xác và độ tin cậy của phân tích hình ảnhCác nhiệm vụ trong ứng dụng của bạn.

public override void BinarizeOtsu()

ClearBlocks()

Xóa tất cả các khối WebP hiện có từ hình ảnh, tạo điều kiện cho một vỏ sạchthay đổi hoặc bổ sung sau đó. Sử dụng phương pháp này để cài đặt lại hiệu quảcấu trúc khối trong dữ liệu hình ảnh WebP, đảm bảo quản lý tối ưu vàtổ chức nội dung hình ảnh trong ứng dụng của bạn.

public void ClearBlocks()

Crop(Rectangle)

trồng hình ảnh bằng cách sử dụng một khu vực thẳng cụ thể, loại bỏ các phần không mong muốntrong khi duy trì nội dung mong muốn. tích hợp phương pháp này vào hình ảnh của bạnxử lý dòng công việc để thu thập chính xác và tập trung vào các lĩnh vực quan tâm cụ thểtrong hình ảnh, tăng độ rõ ràng và thành phần cho các ứng dụng khác nhau.

public override void Crop(Rectangle rectangle)

Parameters

rectangle Rectangle

Vòng thẳng.

Crop(int, int, int, int, int)

trồng hình ảnh bằng cách áp dụng các chuyển đổi trái, phải, trên và dưới, hiệu quảchọn một khu vực quan tâm trong hình ảnh. Sử dụng phương pháp này đểlấy đi năng động các phần mong muốn của hình ảnh trong khi điều chỉnh thành phần của nóvà tập trung theo yêu cầu của ứng dụng của bạn.

public override void Crop(int leftShift, int rightShift, int topShift, int bottomShift)

Parameters

leftShift int

bên trái thay đổi.

rightShift int

Chuyển đổi đúng

topShift int

Thay đổi hàng đầu

bottomShift int

Thay đổi bên dưới.

Dither(DitheringMethod, int, IColorPalette)

Thực hiện di chuyển trên hình ảnh hiện tại để giảm kết nối màu sắc và nâng cao tầm nhìntích hợp phương pháp này vào dòng công việc xử lý hình ảnh của bạn để đạt đượcchuyển đổi giữa các màu sắc và cải thiện sự xuất hiện tổng thể củaHình ảnh trong ứng dụng của bạn.

public override void Dither(DitheringMethod ditheringMethod, int bitsCount, IColorPalette customPalette)

Parameters

ditheringMethod DitheringMethod

Phương pháp di chuyển.

bitsCount int

Các bit cuối cùng đếm cho dithering.

customPalette IColorPalette

Thói quen của palette cho dithering.

Filter(Xác định, FilterOptionsBase)

Bộ lọc nội dung trong góc thẳng cụ thể, áp dụng một hình ảnh được chỉ địnhbộ lọc xử lý để cải thiện hoặc sửa đổi khu vực đã chọn.vào dòng công việc thao tác hình ảnh của bạn để đạt được các cải tiến được nhắm mục tiêu hoặcThay đổi trong ứng dụng của bạn.

public override void Filter(Rectangle rectangle, FilterOptionsBase options)

Parameters

rectangle Rectangle

Vòng thẳng.

options FilterOptionsBase

Các tùy chọn.

Examples

Ví dụ sau đây áp dụng các loại bộ lọc khác nhau cho một hình ảnh WEBP.

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

                                                                                  using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.webp"))
                                                                                  {
                                                                                      Aspose.Imaging.FileFormats.Webp.WebPImage webpImage = (Aspose.Imaging.FileFormats.Webp.WebPImage)image;

                                                                                      // Apply a median filter with a rectangle size of 5 to the entire image.
                                                                                      webpImage.Filter(webpImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.MedianFilterOptions(5));
                                                                                      webpImage.Save(dir + "sample.MedianFilter.png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                                  }

                                                                                  using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.webp"))
                                                                                  {
                                                                                      Aspose.Imaging.FileFormats.Webp.WebPImage webpImage = (Aspose.Imaging.FileFormats.Webp.WebPImage)image;

                                                                                      // Apply a bilateral smoothing filter with a kernel size of 5 to the entire image.
                                                                                      webpImage.Filter(webpImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.BilateralSmoothingFilterOptions(5));
                                                                                      webpImage.Save(dir + "sample.BilateralSmoothingFilter.png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                                  }

                                                                                  using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.webp"))
                                                                                  {
                                                                                      Aspose.Imaging.FileFormats.Webp.WebPImage webpImage = (Aspose.Imaging.FileFormats.Webp.WebPImage)image;

                                                                                      // Apply a Gaussian blur filter with a radius of 5 and a sigma value of 4.0 to the entire image.
                                                                                      webpImage.Filter(webpImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.GaussianBlurFilterOptions(5, 4.0));
                                                                                      webpImage.Save(dir + "sample.GaussianBlurFilter.png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                                  }

                                                                                  using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.webp"))
                                                                                  {
                                                                                      Aspose.Imaging.FileFormats.Webp.WebPImage webpImage = (Aspose.Imaging.FileFormats.Webp.WebPImage)image;

                                                                                      // Apply a Gauss-Wiener filter with a radius of 5 and a smooth value of 4.0 to the entire image.
                                                                                      webpImage.Filter(webpImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.GaussWienerFilterOptions(5, 4.0));
                                                                                      webpImage.Save(dir + "sample.GaussWienerFilter.png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                                  }

                                                                                  using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.webp"))
                                                                                  {
                                                                                      Aspose.Imaging.FileFormats.Webp.WebPImage webpImage = (Aspose.Imaging.FileFormats.Webp.WebPImage)image;

                                                                                      // Apply a motion wiener filter with a length of 5, a smooth value of 4.0 and an angle of 90.0 degrees to the entire image.
                                                                                      webpImage.Filter(webpImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.MotionWienerFilterOptions(10, 1.0, 90.0));
                                                                                      webpImage.Save(dir + "sample.MotionWienerFilter.png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                                  }

                                                                                  using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.webp"))
                                                                                  {
                                                                                      Aspose.Imaging.FileFormats.Webp.WebPImage webpImage = (Aspose.Imaging.FileFormats.Webp.WebPImage)image;

                                                                                      // Apply a sharpen filter with a kernel size of 5 and a sigma value of 4.0 to the entire image.
                                                                                      webpImage.Filter(webpImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.SharpenFilterOptions(5, 4.0));
                                                                                      webpImage.Save(dir + "sample.SharpenFilter.png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                                  }

Grayscale()

Chuyển đổi hình ảnh thành đại diện rực rỡ của nó, biến nó thành mộtHình ảnh kênh duy nhất nơi mỗi pixel đại diện cho cường độ hoặc ánh sáng.phương pháp này vào đường ống xử lý hình ảnh của bạn để đơn giản hóa phân tích và cải thiệntương thích với các thuật toán dựa trên grayscale, tạo điều kiện cho các máy tính khác nhauCác nhiệm vụ phân tích tầm nhìn và hình ảnh trong ứng dụng của bạn.

public override void Grayscale()

InsertBlock(Nhãn hiệu: IFrame)

Nhập một khối WebP mới vào chỉ số cụ thể trong hình ảnh, cho phép chính xáckiểm soát qua chuỗi khối. tích hợp phương pháp này để kết hợpCác khối WebP bổ sung vào cấu trúc dữ liệu hình ảnh, tạo điều kiện cho hình dạng tiên tiếnxử lý và tối ưu hóa trong ứng dụng của bạn.

public void InsertBlock(int index, IFrame block)

Parameters

index int

Các yếu tố dựa trên không, trong đó block’ sẽ được nhập.

block IFrame

Webp block để thêm.

ReleaseManagedResources()

Hãy chắc chắn rằng không có tài nguyên không được quản lý được phát hành ở đây, vì chúng có thể đã đượcđã được phát hành.

protected override void ReleaseManagedResources()

RemoveBlock(IFRAM)

Xóa khối WebP cụ thể từ hình ảnh, tạo điều kiện quản lý hiệu quảcủa cấu trúc dữ liệu hình ảnh. Sử dụng phương pháp này để nhanh chóng xử lý ảnhdòng công việc bằng cách loại bỏ các khối hoặc thành phần không cần thiết trong ứng dụng của bạn.

public void RemoveBlock(IFrame block)

Parameters

block IFrame

Block để loại bỏ.

Remarks

Lưu ý: đừng quên cài đặt block’ nếu bạn không muốn thêm nó vào một số WebPImage khác.

Resize(int, int, resizeType)

Đổi lại hình ảnh, điều chỉnh kích thước của nó trong khi duy trì tỷ lệ khía cạnh.Kết hợp phương pháp này vào dòng công việc xử lý hình ảnh của bạn để quy mô năng độnghình ảnh để phù hợp với các yêu cầu hiển thị hoặc lưu trữ khác nhau trong ứng dụng của bạn.

public override void Resize(int newWidth, int newHeight, ResizeType resizeType)

Parameters

newWidth int

Chiều rộng mới

newHeight int

Độ cao mới

resizeType ResizeType

Loại Resize

Examples

Ví dụ này tải một hình ảnh WEBP và resize nó bằng cách sử dụng các phương pháp resizing khác nhau.

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

                                                                                         using (Aspose.Imaging.FileFormats.Webp.WebPImage image = (Aspose.Imaging.FileFormats.Webp.WebPImage)Aspose.Imaging.Image.Load(dir + "sample.webp"))
                                                                                         {
                                                                                             // Scale up by 2 times using Nearest Neighbour resampling.
                                                                                             image.Resize(image.Width* 2, image.Height* 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);

                                                                                             // Save to PNG with default options.
                                                                                             image.Save(dir + "upsample.nearestneighbour.png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                                         }

                                                                                         using (Aspose.Imaging.FileFormats.Webp.WebPImage image = (Aspose.Imaging.FileFormats.Webp.WebPImage)Aspose.Imaging.Image.Load(dir + "sample.webp"))
                                                                                         {
                                                                                             // Scale down by 2 times using Nearest Neighbour resampling.
                                                                                             image.Resize(image.Width / 2, image.Height / 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);

                                                                                             // Save to PNG with default options.
                                                                                             image.Save(dir + "downsample.nearestneighbour.png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                                         }

                                                                                         using (Aspose.Imaging.FileFormats.Webp.WebPImage image = (Aspose.Imaging.FileFormats.Webp.WebPImage)Aspose.Imaging.Image.Load(dir + "sample.webp"))
                                                                                         {
                                                                                             // Scale up by 2 times using Bilinear resampling.
                                                                                             image.Resize(image.Width* 2, image.Height* 2, Aspose.Imaging.ResizeType.BilinearResample);

                                                                                             // Save to PNG with default options.
                                                                                             image.Save(dir + "upsample.bilinear.png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                                         }

                                                                                         using (Aspose.Imaging.FileFormats.Webp.WebPImage image = (Aspose.Imaging.FileFormats.Webp.WebPImage)Aspose.Imaging.Image.Load(dir + "sample.webp"))
                                                                                         {
                                                                                             // Scale down by 2 times using Bilinear resampling.
                                                                                             image.Resize(image.Width / 2, image.Height / 2, Aspose.Imaging.ResizeType.BilinearResample);

                                                                                             // Save to PNG with default options.
                                                                                             image.Save(dir + "downsample.bilinear.png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                                         }

Resize(int, int, ImageResizeSettings)

Đổi lại hình ảnh theo cài đặt cụ thể, cho phép kiểm soát chính xáckích thước, tỷ lệ khía cạnh, và hành vi quy mô. tích hợp phương pháp này vàodòng công việc xử lý hình ảnh để đạt được các hoạt động phục hồi tùy chỉnhcác yêu cầu cụ thể của ứng dụng của bạn.

public override void Resize(int newWidth, int newHeight, ImageResizeSettings settings)

Parameters

newWidth int

Chiều rộng mới

newHeight int

Độ cao mới

settings ImageResizeSettings

Các thiết lập resize.

ResizeHeightProportionally(Nhãn hiệu: ResizeType)

Điều chỉnh chiều cao của hình ảnh một cách tương đối, trong khi duy trì tỷ lệ khía cạnh của nótích hợp phương pháp này vào dòng công việc xử lý hình ảnh của bạnđể quay lại hình ảnh một cách năng động với tỷ lệ đồng nhất, đảm bảo hiển thị tối ưu hoặclưu trữ trong ứng dụng của bạn.

public override void ResizeHeightProportionally(int newHeight, ResizeType resizeType)

Parameters

newHeight int

Độ cao mới

resizeType ResizeType

Loại của resize.

ResizeWidthProportionally(Nhãn hiệu: ResizeType)

Tương tự điều chỉnh chiều rộng của hình ảnh trong khi duy trì tỷ lệ khía cạnh của nó.Kết hợp phương pháp này vào dòng công việc xử lý hình ảnh của bạn để chuyển đổi năng độnghình ảnh với tỷ lệ liên tục, đảm bảo hiển thị hoặc lưu trữ tối ưu trongứng dụng của bạn.

public override void ResizeWidthProportionally(int newWidth, ResizeType resizeType)

Parameters

newWidth int

Chiều rộng mới

resizeType ResizeType

Loại của resize.

Rotate(Float, Bool, Màu sắc)

xoay hình ảnh xung quanh trung tâm của nó bằng một góc cụ thể, trong khi tương đốikhôi phục lại nó và áp dụng các thông số màu nền cụ thể.phương pháp vào dòng công việc xử lý hình ảnh của bạn để đạt được chuyển đổi chính xác vớitùy chỉnh màu nền, đảm bảo hiển thị hình ảnh tối ưu trong nội bộ của bạnứng dụng .

public override void Rotate(float angle, bool resizeProportionally, Color backgroundColor)

Parameters

angle float

góc xoay trong độ. giá trị tích cực sẽ xoay theo cách đồng hồ.

resizeProportionally bool

Nếu được thiết lập để ’truyền’ bạn sẽ có kích thước hình ảnh của bạn thay đổi theo các dự án thẳng góc (các điểm góc) quay trong trường hợp khác để lại các kích cỡ không bị chạm và chỉ nội bộ nội dung ảnh được quay.

backgroundColor Color

Màu sắc của nền

RotateFlip(RotateFlipType)

Ứng dụng xoay, nhấp nháy, hoặc cả hai hoạt động độc quyền vào khung tích cựctích hợp phương pháp này vào dòng công việc xử lý hình ảnh của bạn đểđảm bảo việc thao tác chính xác của các khung cá nhân, tăng tính linh hoạt vàkiểm soát các biến đổi khung trong ứng dụng của bạn.

public override void RotateFlip(RotateFlipType rotateFlipType)

Parameters

rotateFlipType RotateFlipType

Loại Flip Rotate

SaveData(Stream)

Tiết kiệm dữ liệu

protected override void SaveData(Stream stream)

Parameters

stream Stream

Stream để lưu dữ liệu đến.

UpdateDimensions(int, int)

Cập nhật kích thước hình ảnh.

protected override void UpdateDimensions(int newWidth, int newHeight)

Parameters

newWidth int

Hình ảnh mới rộng.

newHeight int

Độ cao hình ảnh mới.

 Tiếng Việt