Class GifImage

Class GifImage

名称: Aspose.Imaging.FileFormats.Gif アセンション: Aspose.Imaging.dll (25.4.0)

API for Graphical Interchange Format (GIF) 画像ファイルは、複雑なツールを備えた開発者は、圧縮されたラスター画像を処理し、アニメーション GIFs. XMP メタデータ処理、色パレットなどの機能を提供設定、背景および透明な色制御、不透明性設定、リサイクル、crop, フィルターアプリケーション, ガマ修正, 対照調整, グレイスケール変換、および他のフォーマットへの変換. この API は無制限の機能を提供します幅広いアプリケーションのためのGIF画像の操作と改善。

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

Inheritance

object DisposableObject DataStreamSupporter Image RasterImage RasterCachedImage RasterCachedMultipageImage GifImage

Implements

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

相続人

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

GIF画像からアニメーションの一部を時間間隔に基づいて輸出する。

using (var image = Image.Load("Animation.gif"))
                                                                             {
                                                                                 var options = new GifOptions
                                                                                 {
                                                                                     FullFrame = true,
                                                                                     MultiPageOptions = new MultiPageOptions
                                                                                     {
                                                                                         Mode = MultiPageMode.TimeInterval,
                                                                                         TimeInterval = new TimeInterval(0, 400)
                                                                                     }
                                                                                 };

                                                                                 image.Save("PartOfAnimation.gif", options);
                                                                             }

この例では、GIF画像を作成し、ファイルに保存する方法を示しています。

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

                                                                              // Create a GIF Frame block of 100x100 px.
                                                                              using (Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock firstBlock = new Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock(100, 100))
                                                                              {
                                                                                  // Fill the entire block in red.
                                                                                  Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(firstBlock);
                                                                                  Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.Red);
                                                                                  gr.FillRectangle(brush, firstBlock.Bounds);

                                                                                  using (Aspose.Imaging.FileFormats.Gif.GifImage gifImage = new Aspose.Imaging.FileFormats.Gif.GifImage(firstBlock))
                                                                                  {
                                                                                      gifImage.Save(dir + "output.gif");
                                                                                  }
                                                                              }

単一ページのラスター画像を使用して複数のページのGIF画像を作成します。

static void Main(string[] args)
                                                                      {
                                                                          // Load frames
                                                                          var frames = LoadFrames("Animation frames").ToArray();

                                                                          // Create GIF image using the first frame
                                                                          using (var image = new GifImage(new GifFrameBlock(frames[0])))
                                                                          {
                                                                              // Add frames to the GIF image using the AddPage method
                                                                              for (var index = 1; index < frames.Length; index++)
                                                                              {
                                                                                  image.AddPage(frames[index]);
                                                                              }

                                                                              // Save GIF image
                                                                              image.Save("Multipage.gif");
                                                                          }
                                                                      }

                                                                      private static IEnumerable<rasterimage> LoadFrames(string directory)
                                                                      {
                                                                          foreach (var filePath in Directory.GetFiles(directory))
                                                                          {
                                                                              yield return (RasterImage)Image.Load(filePath);
                                                                          }
                                                                      }</rasterimage>

Constructors

GifImage(GifFrameブロック、IColorPalette)

新しい Aspose.Imaging.FileFormats.Gif.GifImage オブジェクトを指定したパラメーターで開始します。ファーストフレームとグローバルパレット. GIF 画像を迅速に管理し始める最適な結果のためのカスタマイズ可能な設定で正確な表現。

public GifImage(GifFrameBlock firstFrame, IColorPalette globalPalette)

Parameters

firstFrame GifFrameBlock

最初のフレームは、GIF画像を起動させます。

globalPalette IColorPalette

firstFrame’ と globalPalette’ がゼロである場合は、デフォルトグローバルパレットが使用されます。

Examples

この例では、カスタマイズされたパレットでGIF画像を作成し、ファイルに保存する方法を示しています。

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

                                                                                                    // Create a GIF Frame block of 100x100 px.
                                                                                                    using (Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock firstBlock = new Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock(100, 100))
                                                                                                    {
                                                                                                        // Fill the entire block in red.
                                                                                                        Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(firstBlock);
                                                                                                        Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.Red);
                                                                                                        gr.FillRectangle(brush, firstBlock.Bounds);

                                                                                                        // Use 4-bit palette to reduce the image size. The quality can get worse.
                                                                                                        Aspose.Imaging.IColorPalette palette = Aspose.Imaging.ColorPaletteHelper.Create4Bit();

                                                                                                        using (Aspose.Imaging.FileFormats.Gif.GifImage gifImage = new Aspose.Imaging.FileFormats.Gif.GifImage(firstBlock, palette))
                                                                                                        {
                                                                                                            gifImage.Save(dir + "output.gif");
                                                                                                        }
                                                                                                    }

Exceptions

ArgumentNullException

firstFrame’ はゼロではありません。

ArgumentException

firstFrame’ はすでに他の画像に属しています。

GifImageException

<コードクラス=“パラムレフ”>グローバルパレットの指定は、2のパワーに等しい入力数を含むべきです 最小パレットサイズは2、最大は256です。

GifImage(GifFrameBlock)

GIF 画像を作成することは、Aspose.Imaging.FileFormats.Gif.GifImage で無力になります。ファーストフレームパラメーターのみで、それはダイナミックな世界に入ります。ビジュアルコミュニケーション

public GifImage(GifFrameBlock firstFrame)

Parameters

firstFrame GifFrameBlock

最初のフレームは、GIF画像を起動させます。

Examples

この例では、GIF画像を作成し、ファイルに保存する方法を示しています。

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

                                                                              // Create a GIF Frame block of 100x100 px.
                                                                              using (Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock firstBlock = new Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock(100, 100))
                                                                              {
                                                                                  // Fill the entire block in red.
                                                                                  Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(firstBlock);
                                                                                  Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.Red);
                                                                                  gr.FillRectangle(brush, firstBlock.Bounds);

                                                                                  using (Aspose.Imaging.FileFormats.Gif.GifImage gifImage = new Aspose.Imaging.FileFormats.Gif.GifImage(firstBlock))
                                                                                  {
                                                                                      gifImage.Save(dir + "output.gif");
                                                                                  }
                                                                              }

下記の例では、個々のGIFブロックからアニメ化されたGIF画像を構成する方法を示しています。

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

                                                                                                       // Create a GIF image 100 x 100 px.
                                                                                                       // The first block is fully black by default.
                                                                                                       using (Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock firstBlock = new Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock(100, 100))
                                                                                                       using (Aspose.Imaging.FileFormats.Gif.GifImage gifImage = new Aspose.Imaging.FileFormats.Gif.GifImage(firstBlock))
                                                                                                       {
                                                                                                           // 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 &lt;= 360; angle += 10)
                                                                                                           {
                                                                                                               Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock block = new Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock(100, 100);

                                                                                                               Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(block);
                                                                                                               gr.FillPie(brush1, block.Bounds, 0, angle);

                                                                                                               gifImage.AddBlock(block);
                                                                                                           }

                                                                                                           // Gradually inscrease the angle of the black arc and wipe out the red arc.
                                                                                                           for (int angle = 10; angle &lt;= 360; angle += 10)
                                                                                                           {
                                                                                                               Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock block = new Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock(100, 100);

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

                                                                                                               gifImage.AddBlock(block);
                                                                                                           }

                                                                                                           gifImage.Save(dir + "animated_radar.gif");
                                                                                                       }

Exceptions

ArgumentNullException

firstFrame’ はゼロではありません。

ArgumentException

firstFrame’ はすでに他の画像に属しています。

GifImageException

指定されたパレットには、2のパワーに等しい入力数が含まれる必要があります 最小パレットサイズは2、最大は256です。

GifImage(GifFrameBlock、IColorPalette、ボール、バイト、バイト、ボール)

Aspose.Imaging.FileFormats.Gif.GifImage コンストラクターで簡単にスタートします。シンプルな方法で、簡単にアニメ化されたGIFを作成することができます。firstFrame、グローバルパレット、パレットColorResolution、 aspectRatio、およびその他パラメーター、そしてあなたはあなたのビジョンを生かす準備ができています。

public GifImage(GifFrameBlock firstFrame, IColorPalette globalPalette, bool isPaletteSorted, byte paletteColorResolution, byte paletteBackgroundColorIndex, byte aspectRatio, bool hasTrailer)

Parameters

firstFrame GifFrameBlock

最初のフレームは、GIF画像を起動させます。

globalPalette IColorPalette

firstFrame’ と globalPalette’ がゼロである場合は、デフォルトグローバルパレットが使用されます。

isPaletteSorted bool

「真実」に設定された場合、パレットが分類されます. globalPalette" が null で使用される場合にパラメーターが表示されます。

paletteColorResolution byte

パレットの色の解像度 パラメーターは、 globalPalette’ が null でないときに使用されます。

paletteBackgroundColorIndex byte

背景色インデックス。

aspectRatio byte

側面の比率

hasTrailer bool

If set to ’true’ the gif image has trailer otherwise no trailer written at the end of the stream. もし「真実」に設定された場合、GIF画像にはトレーラーが書かれていません。

Exceptions

ArgumentNullException

firstFrame’ はゼロではありません。

ArgumentException

firstFrame’ はすでに他の画像に属しています。

GifImageException

<コードクラス=“パラムレフ”>グローバルパレットの指定は、2のパワーに等しい入力数を含むべきです 最小パレットサイズは2、最大は256です。

Properties

ActiveFrame

この特性でフレームを管理し、操作し、柔らかいナビゲーションを可能にし、GIF画像内のアクティブフレームの変更

public GifFrameBlock ActiveFrame { get; set; }

不動産価値

GifFrameBlock

Examples

下記の例では、GIF画像からすべてのブロックを削除する方法を示しています。

using (Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock firstBlock = new Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock(100, 100))
                                                                                 using (Aspose.Imaging.FileFormats.Gif.GifImage gifImage = new Aspose.Imaging.FileFormats.Gif.GifImage(firstBlock))
                                                                                 {
                                                                                     if (gifImage.ActiveFrame != null)
                                                                                     {
                                                                                         System.Console.WriteLine("Active frame size: {0}", gifImage.ActiveFrame.Size);
                                                                                     }
                                                                                     else
                                                                                     {
                                                                                         System.Console.WriteLine("Active frame is not set");
                                                                                     }

                                                                                     System.Console.WriteLine("Clear all the blocks");
                                                                                     gifImage.ClearBlocks();

                                                                                     if (gifImage.ActiveFrame != null)
                                                                                     {
                                                                                         System.Console.WriteLine("Active frame size: {0}", gifImage.ActiveFrame.Size);
                                                                                     }
                                                                                     else
                                                                                     {
                                                                                         System.Console.WriteLine("Active frame is not set");
                                                                                     }
                                                                                 }

                                                                                 // The output looks like this:
                                                                                 // Active frame size: { Width = 100, Height = 100}
                                                                                 // Clear all the blocks
                                                                                 // Active frame is not set

BackgroundColor

この属性でGIF画像の背景色を管理します。背景の色を取り戻し、一貫性を確保し、視覚的な魅力を高める。

public override Color BackgroundColor { get; set; }

不動産価値

Color

BackgroundColorIndex

この属性を使用してGIF画像の背景色指数を制御します。インデックスを取り戻し、一貫性を維持したり、望ましい視覚効果を達成したりします。

public byte BackgroundColorIndex { get; set; }

不動産価値

byte

Blocks

GIFブロックへのアクセスをこの不動産で無線に取得し、簡単に画像の基礎データ構造の収集および操作。

public IGifBlock[] Blocks { get; }

不動産価値

IGifBlock ( )

FileFormat

この属性でファイルフォーマットを無力に復元します. それはあなたの行くソースですあなたのファイルのフォーマットを特定するために、あなたのワークフローに無制限に統合され、重要な情報は、いかなる混乱もなく提供します。

public override FileFormat FileFormat { get; }

不動産価値

FileFormat

HasBackgroundColor

この属性は、GIF画像に背景色が含まれているかどうかを決定します。確かに、それは画像に背景色が含まれていることを示しています。

public override bool HasBackgroundColor { get; }

不動産価値

bool

HasTrailer

この属性であなたのGIFファイルにトレーラーの存在を管理します。トレーラーが存在するかどうかを確認する必要があるか、あるいはその存在を設定する必要があるか、この財産は単純化する。プロセス: GIF ファイルを構造化し、この直感的な機能と一致させます。

public bool HasTrailer { get; set; }

不動産価値

bool

HasTransparentColor

GIF画像のアクティブフレームには透明な色が含まれているかどうかを決定します。この不動産は、画像内の透明性を確認するための便利な方法を提供します。

public override bool HasTransparentColor { get; set; }

不動産価値

bool

ImageOpacity

画像内のアクティブフレームの不透明性を回復し、洞察を提供します。その透明性のレベル. この特性は、特に理解するのに役立ちます。画像のアクティブフレームの透明性または不透明性の程度。

public override float ImageOpacity { get; }

不動産価値

float

IsInterlaced

画像が接続されているかどうかを決定し、充電中にその表示に影響を与える。財産は、イメージの表現行動に洞察を提供し、不可欠です。充電戦略を最適化し、全体的な視聴体験を向上させる。

public bool IsInterlaced { get; }

不動産価値

bool

IsPaletteSorted

この属性を使用してGIF画像のパレットの分類をコントロールします。パレットが分類されているか、または分類行動を設定しているかどうかを確認する必要があります。財産は、あなたのパレット組織を管理するための簡単な方法を提供します。GIFファイル

public bool IsPaletteSorted { get; set; }

不動産価値

bool

LoopsCount

この属性で無力にロープ数を回復します. GIF 画像が含まれている場合ロップ情報、この不動産は、ロップ計算に迅速なアクセスを提供し、あなたは、あなたのGIFファイルのローピング行動を無意識に管理します。

public int LoopsCount { get; set; }

不動産価値

int

PageCount

この画像に含まれるページの総数を修正するシンプルな属性. 画像の内容の範囲を迅速に評価するのに最適です。

public override int PageCount { get; }

不動産価値

int

Pages

この便利な財産を通じて画像内のページへのアクセスを得る、必要に応じて個々のページの無線ナビゲーションおよび操作を可能にします。

public override Image[] Pages { get; }

不動産価値

Image ( )

PaletteColorResolutionBits

この特性でGIF画像のパレット色解像度を管理します。パレット内の色を表すために使用されるビットの数、優れたコントロールを提供色の深さと画像の質

public byte PaletteColorResolutionBits { get; set; }

不動産価値

byte

PixelAspectRatio

この属性とGIF画像のピクセル側面比率を管理します。正確な表現を確保し、視覚的忠誠を維持するための側面比率。

public byte PixelAspectRatio { get; set; }

不動産価値

byte

TransparentColor

GIF画像のアクティブフレームの透明な色を取り戻します。透明に指定された特定の色にアクセスできます。現在のアクティブな枠内で

public override Color TransparentColor { get; }

不動産価値

Color

XmpData

この属性でXMPメタデータを管理します. 既存のメタデータを取得しているかどうかまたは新しい情報で更新する場合、この所有物はプロセスを簡素化します。あなたのメタデータが組織化され、アクセス可能であり、あなたのファイルがコンテンツを含むことを保証します。必要な情報です。

public override XmpPacketWrapper XmpData { get; set; }

不動産価値

XmpPacketWrapper

Methods

AddBlock(IGIFブロック)

新しいGIFブロックを追加すると、画像に追加のデータが含まれることができます。この方法では、GIF画像にカスタマイズブロックを追加することができます。さまざまな種類の情報が含まれています。

public void AddBlock(IGifBlock block)

Parameters

block IGifBlock

GIFブロックを追加します。

Examples

下記の例では、個々のGIFブロックからアニメ化されたGIF画像を構成する方法を示しています。

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

                                                                                                       // Create a GIF image 100 x 100 px.
                                                                                                       // The first block is fully black by default.
                                                                                                       using (Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock firstBlock = new Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock(100, 100))
                                                                                                       using (Aspose.Imaging.FileFormats.Gif.GifImage gifImage = new Aspose.Imaging.FileFormats.Gif.GifImage(firstBlock))
                                                                                                       {
                                                                                                           // 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 &lt;= 360; angle += 10)
                                                                                                           {
                                                                                                               Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock block = new Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock(100, 100);

                                                                                                               Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(block);
                                                                                                               gr.FillPie(brush1, block.Bounds, 0, angle);

                                                                                                               gifImage.AddBlock(block);
                                                                                                           }

                                                                                                           // Gradually inscrease the angle of the black arc and wipe out the red arc.
                                                                                                           for (int angle = 10; angle &lt;= 360; angle += 10)
                                                                                                           {
                                                                                                               Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock block = new Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock(100, 100);

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

                                                                                                               gifImage.AddBlock(block);
                                                                                                           }

                                                                                                           gifImage.Save(dir + "animated_radar.gif");
                                                                                                       }

AddPage(RasterImage)

新しいページを既存の画像に無線に挿入し、そのコンテンツを強化します。この方法は、画像コレクションを追加で拡大します。コンテンツ、イメージ管理と構成における創造性と柔軟性を促進する。

public void AddPage(RasterImage page)

Parameters

page RasterImage

追加するページです。

Examples

単一ページのラスター画像を使用して複数のページのGIF画像を作成します。

static void Main(string[] args)
                                                                      {
                                                                          // Load frames
                                                                          var frames = LoadFrames("Animation frames").ToArray();

                                                                          // Create GIF image using the first frame
                                                                          using (var image = new GifImage(new GifFrameBlock(frames[0])))
                                                                          {
                                                                              // Add frames to the GIF image using the AddPage method
                                                                              for (var index = 1; index &lt; frames.Length; index++)
                                                                              {
                                                                                  image.AddPage(frames[index]);
                                                                              }

                                                                              // Save GIF image
                                                                              image.Save("Multipage.gif");
                                                                          }
                                                                      }

                                                                      private static IEnumerable<rasterimage> LoadFrames(string directory)
                                                                      {
                                                                          foreach (var filePath in Directory.GetFiles(directory))
                                                                          {
                                                                              yield return (RasterImage)Image.Load(filePath);
                                                                          }
                                                                      }</rasterimage>

Exceptions

ArgumentNullException

page’ is null.

AdjustBrightness(インタ)

画像の明るさを指定した<コードクラス=“paramref”>明るさのパラメーターに従って調整します この方法は、画像全体の明るさを均一に変更し、望ましい効果を達成するために全体の明るさを強化または減少させます。

public override void AdjustBrightness(int brightness)

Parameters

brightness int

明るさの価値

Examples

下記の例では、GIF画像の明るさ修正を実行します。

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

                                                                               using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
                                                                               {
                                                                                   Aspose.Imaging.FileFormats.Gif.GifImage gifImage = (Aspose.Imaging.FileFormats.Gif.GifImage)image;

                                                                                   // Set the brightness value. The accepted values of brightness are in the range [-255, 255].
                                                                                   gifImage.AdjustBrightness(50);
                                                                                   gifImage.Save(dir + "sample.AdjustBrightness.png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                               }

AdjustContrast(フラット)

画像の対比を調整し、画像の違いを強化または減少させる。ピクセルの間の明るさ この方法は、画像の全体的なトーン範囲を変更します。暗い領域を暗くし、明るい領域を明るくし、視覚的明るさを向上させる。そして詳細。

public override void AdjustContrast(float contrast)

Parameters

contrast float

対照値(範囲内(100、100)

Examples

下記の例では、GIF画像の対照修正を実行します。

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

                                                                             using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
                                                                             {
                                                                                 Aspose.Imaging.FileFormats.Gif.GifImage gifImage = (Aspose.Imaging.FileFormats.Gif.GifImage)image;

                                                                                 // Set the contrast value. The accepted values of contrast are in the range [-100f, 100f].
                                                                                 gifImage.AdjustContrast(50f);
                                                                                 gifImage.Save(dir + "sample.AdjustContrast.png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                             }

Exceptions

ImageException

「フレームインデックス」+フレームインデックス

AdjustGamma(フラット)

画像の質を向上させ、ガマ修正を適用します。この方法は色を調整します。画像のガマは、最適な視覚の明るさを達成するために、ガマ値を変更します。それぞれのピクセルで、色の表現と全体的なイメージの外観を改善します。

public override void AdjustGamma(float gamma)

Parameters

gamma float

レッド・グリーン・ブルー・チャンネルのGAMMA

Examples

下記の例では、GIF画像のガマ修正を実行します。

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

                                                                          using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
                                                                          {
                                                                              Aspose.Imaging.FileFormats.Gif.GifImage gifImage = (Aspose.Imaging.FileFormats.Gif.GifImage)image;

                                                                              // Set gamma coefficient for red, green and blue channels.
                                                                              gifImage.AdjustGamma(2.5f);
                                                                              gifImage.Save(dir + "sample.AdjustGamma.png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                          }

AdjustGamma(フラット、フラット、フラット)

画像のガム修正は、ピクセル値に対する非線形調整を適用します。赤色の指標に基づいて明るさを強化または減少させる。緑と青のチャンネル. この方法は、色のバランスを薄くするのに役立ちます。画像の明るさ、全体的な外観と視覚的品質を向上させる。

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

Parameters

gammaRed float

レッドチャンネルのGamma Coefficient

gammaGreen float

グリーンチャンネルのGamma Coefficient

gammaBlue float

ブルーチャンネルのGamma Coefficient

Examples

下記の例では、色のコンポーネントに異なるコーヒーを適用するGIF画像のガマ修正を実行します。

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

                                                                                                                               using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
                                                                                                                               {
                                                                                                                                   Aspose.Imaging.FileFormats.Gif.GifImage gifImage = (Aspose.Imaging.FileFormats.Gif.GifImage)image;

                                                                                                                                   // Set individual gamma coefficients for red, green and blue channels.
                                                                                                                                   gifImage.AdjustGamma(1.5f, 2.5f, 3.5f);
                                                                                                                                   gifImage.Save(dir + "sample.AdjustGamma.png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                                                                               }

BinarizeBradley(ダブル)

イメージのバイナリ化は、ブラッドリーの適応範囲アルゴリズムを使用してIntegral image thresholding は、グレイスケール画像をグレイスケール画像に変換する方法です。このアルゴリズムは、それぞれのピクセルに基づいて地元の限界を計算します。指定されたウィンドウ内の周囲のピクセルの平均強度。地元のピクセル強度に基づいて限界を適応的に調整し、ブラッドリーのこの方法は、画像全体の照明と対照の変動に対処するのに効果的です。

public override void BinarizeBradley(double brightnessDifference)

Parameters

brightnessDifference double

ピクセルとこのピクセルの周りに焦点を当てたピクセルのS x sウィンドウの平均の明るさの違い。

BinarizeFixed(ビート)

既定の範囲を持つ画像のバイナリ化は、グレースケールまたは色を変換します。画像はバイナリー画像に分類され、それぞれのピクセルがブラックまたはホワイトとして分類されます。強度値が定められた限界を超えるかどうかを問う。

public override void BinarizeFixed(byte threshold)

Parameters

threshold byte

ピクセルの関連するグレー値が限界を上回る場合、255の値が割り当てられます。

Examples

次の例では、既定の範囲を持つGIF画像をバイナリ化します. バイナリ化された画像には、黒と白の2色のみが含まれています。

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

                                                                                                                                               using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
                                                                                                                                               {
                                                                                                                                                   Aspose.Imaging.FileFormats.Gif.GifImage djvuImage = (Aspose.Imaging.FileFormats.Gif.GifImage)image;

                                                                                                                                                   // Binarize the image with a threshold value of 127.
                                                                                                                                                   // If a corresponding gray value of a pixel is greater than 127, a value of 255 will be assigned to it, 0 otherwise.
                                                                                                                                                   djvuImage.BinarizeFixed(127);
                                                                                                                                                   djvuImage.Save(dir + "sample.BinarizeFixed.png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                                                                                               }

BinarizeOtsu()

Otsu thresholding による画像のバイナリ化は、自動的に使用される方法です。グレイスケール画像をグレイスケール画像に変換するための最適な限界値を決定するバイナリー画像. Otsu 限界アルゴリズムは、その限界を計算します。ピクセル強度のクラス内変数を最小限にする2つの結果クラス(前面および背景) このテクニックは特に役に立つ最適限値は不明であり、適応的に決定する必要があります。画像のヒストグラム。

public override void BinarizeOtsu()

Examples

次の例では、Otsu の範囲で GIF 画像をバイナリ化します. バイナリ化された画像には、黒と白の 2 色のみが含まれています。

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

                                                                                                                                        using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
                                                                                                                                        {
                                                                                                                                            Aspose.Imaging.FileFormats.Gif.GifImage gifImage = (Aspose.Imaging.FileFormats.Gif.GifImage)image;

                                                                                                                                            // Binarize the image with Otsu thresholding.
                                                                                                                                            gifImage.BinarizeOtsu();
                                                                                                                                            gifImage.Save(dir + "sample.BinarizeOtsu.png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                                                                                        }

ClearBlocks()

すべての GIF ブロックを削除すると、画像内に保存されている既存のデータが削除されます。この操作は効果的に画像を空の状態にリセットし、すべての画像を削除します。以前追加ブロック. この方法を使用するとき、あなたは清潔で新鮮に始める必要がありますGIF画像を作成または変更するためのスライド。

public void ClearBlocks()

Examples

下記の例では、GIF画像からすべてのブロックを削除する方法を示しています。

using (Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock firstBlock = new Aspose.Imaging.FileFormats.Gif.Blocks.GifFrameBlock(100, 100))
                                                                                 using (Aspose.Imaging.FileFormats.Gif.GifImage gifImage = new Aspose.Imaging.FileFormats.Gif.GifImage(firstBlock))
                                                                                 {
                                                                                     if (gifImage.ActiveFrame != null)
                                                                                     {
                                                                                         System.Console.WriteLine("Active frame size: {0}", gifImage.ActiveFrame.Size);
                                                                                     }
                                                                                     else
                                                                                     {
                                                                                         System.Console.WriteLine("Active frame is not set");
                                                                                     }

                                                                                     System.Console.WriteLine("Clear all the blocks");
                                                                                     gifImage.ClearBlocks();

                                                                                     if (gifImage.ActiveFrame != null)
                                                                                     {
                                                                                         System.Console.WriteLine("Active frame size: {0}", gifImage.ActiveFrame.Size);
                                                                                     }
                                                                                     else
                                                                                     {
                                                                                         System.Console.WriteLine("Active frame is not set");
                                                                                     }
                                                                                 }

                                                                                 // The output looks like this:
                                                                                 // Active frame size: { Width = 100, Height = 100}
                                                                                 // Clear all the blocks
                                                                                 // Active frame is not set

Crop(Rectangle)

指定された直角領域を使用して画像を植え、この操作は外部を除去します。画像の部分は、直角によって定義された選択された領域のみを残します。

public override void Crop(Rectangle rectangle)

Parameters

rectangle Rectangle

直角です。

Examples

下記の例はGIF画像を収穫します 収穫の領域は Aspose.Imaging.Rectangle を介して指定されます。

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

                                                                                                                   using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
                                                                                                                   {
                                                                                                                       Aspose.Imaging.FileFormats.Gif.GifImage gifImage = (Aspose.Imaging.FileFormats.Gif.GifImage)image;

                                                                                                                       // Crop the image. The cropping area is the rectangular central area of the image.
                                                                                                                       Aspose.Imaging.Rectangle area = new Aspose.Imaging.Rectangle(gifImage.Width / 4, gifImage.Height / 4, gifImage.Width / 2, gifImage.Height / 2);
                                                                                                                       gifImage.Crop(area);

                                                                                                                       // Save the cropped image to PNG
                                                                                                                       gifImage.Save(dir + "sample.Crop.png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                                                                   }

Dither(DitheringMethod, int, IColorパレット)

このプロセスは、画像の質を向上させます。色の結合を減らし、色の移行を改善し、より柔らかい結果を得る。見た目

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

Parameters

ditheringMethod DitheringMethod

ダイエット方法です。

bitsCount int

最後のビットはディタリングのために数える。

customPalette IColorPalette

ディタリングのためのカスタムパレット。

Examples

下記の例では、GIF画像をアップロードし、異なるパレット深さを用いて範囲と流れのダイタリングを実行します。

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

                                                                                                                            using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
                                                                                                                            {
                                                                                                                                Aspose.Imaging.FileFormats.Gif.GifImage gifImage = (Aspose.Imaging.FileFormats.Gif.GifImage)image;

                                                                                                                                // Perform threshold dithering using 4-bit color palette which contains 16 colors.
                                                                                                                                // The more bits specified the higher quality and the bigger size of the output image.
                                                                                                                                // Note that only 1-bit, 4-bit and 8-bit palettes are supported at the moment.
                                                                                                                                gifImage.Dither(Aspose.Imaging.DitheringMethod.ThresholdDithering, 4, null);

                                                                                                                                gifImage.Save(dir + "sample.ThresholdDithering4.png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                                                                            }

                                                                                                                            using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
                                                                                                                            {
                                                                                                                                Aspose.Imaging.FileFormats.Gif.GifImage gifImage = (Aspose.Imaging.FileFormats.Gif.GifImage)image;

                                                                                                                                // Perform floyd dithering using 1-bit color palette which contains only 2 colors - black and white.
                                                                                                                                // The more bits specified the higher quality and the bigger size of the output image.
                                                                                                                                // Note that only 1-bit, 4-bit and 8-bit palettes are supported at the moment.
                                                                                                                                gifImage.Dither(Aspose.Imaging.DitheringMethod.FloydSteinbergDithering, 1, null);

                                                                                                                                gifImage.Save(dir + "sample.FloydSteinbergDithering1.png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                                                                            }

Filter(Rectangle、FilterOptionsベース)

特定のフィルターを画像の指定された領域に適用し、その視覚を向上させる。品質または望ましいように外観を変更します. この方法は選択的に処理します。定義された直角内のピクセルで、ターゲット調整が行われることを可能にする。周囲の画像データの完全性を維持する。

public override void Filter(Rectangle rectangle, FilterOptionsBase options)

Parameters

rectangle Rectangle

直角です。

options FilterOptionsBase

オプションです。

Examples

下記の例では、GIF画像にさまざまなタイプのフィルターが適用されます。

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

                                                                                 using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
                                                                                 {
                                                                                     Aspose.Imaging.FileFormats.Gif.GifImage gifImage = (Aspose.Imaging.FileFormats.Gif.GifImage)image;

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

                                                                                 using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
                                                                                 {
                                                                                     Aspose.Imaging.FileFormats.Gif.GifImage gifImage = (Aspose.Imaging.FileFormats.Gif.GifImage)image;

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

                                                                                 using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
                                                                                 {
                                                                                     Aspose.Imaging.FileFormats.Gif.GifImage gifImage = (Aspose.Imaging.FileFormats.Gif.GifImage)image;

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

                                                                                 using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
                                                                                 {
                                                                                     Aspose.Imaging.FileFormats.Gif.GifImage gifImage = (Aspose.Imaging.FileFormats.Gif.GifImage)image;

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

                                                                                 using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
                                                                                 {
                                                                                     Aspose.Imaging.FileFormats.Gif.GifImage gifImage = (Aspose.Imaging.FileFormats.Gif.GifImage)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.
                                                                                     gifImage.Filter(gifImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.MotionWienerFilterOptions(10, 1.0, 90.0));
                                                                                     gifImage.Save(dir + "sample.MotionWienerFilter.png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                                 }

                                                                                 using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
                                                                                 {
                                                                                     Aspose.Imaging.FileFormats.Gif.GifImage gifImage = (Aspose.Imaging.FileFormats.Gif.GifImage)image;

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

GetOriginalOptions()

ファイル設定に基づくオリジナルのオプションを復元し、忠誠心を維持するために重要です。画像処理および操作における一貫性. この方法は、シェームレスを可能にしますファイル特定のパラメーターをその後の操作に統合し、正確な引き出しとイメージの本質的な特性に従う。これは、ビットの深さやオリジナルの画像の他のパラメーターを変えられないようにするのに役立ちます。たとえば、ブラックホワイトのPNG画像をピクセル1ビットで充電し、その後ピクセル1ビットで保存します。Aspose.Imaging.DataStreamSupporter.Save(System.String) 方法で、ピクセルごとに 8 ビットの出力 PNG イメージが生成されます。それを避け、ピクセル1ビットでPNG画像を保存するには、この方法を使用して、適切な保存オプションを取得し、それらを通過します。Aspose.Imaging.Image.Save(System.String、Aspose.Imaging.ImageOptionsBase)の方法は、2番目のパラメーターです。

public override ImageOptionsBase GetOriginalOptions()

Returns

ImageOptionsBase

オリジナルファイル設定に基づくオプション

Grayscale()

画像をグレースケールの表現に変換すると、色が変換されます。画像をグレイスケール版に変換し、色情報を削除し、保存します。このプロセスは、画像を灰色の色に簡素化し、適切にする。印刷、文書処理、グレイスケールなどのさまざまなアプリケーション分析

public override void Grayscale()

Examples

下記の例では、色のGIF画像をグレイスケールの表現に変換します。グレイスケール画像は、グレイの色のみで構成され、強度情報のみを持ちます。

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

                                                                                                                                                                                                  using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
                                                                                                                                                                                                  {
                                                                                                                                                                                                      Aspose.Imaging.FileFormats.Gif.GifImage gifImage = (Aspose.Imaging.FileFormats.Gif.GifImage)image;

                                                                                                                                                                                                      gifImage.Grayscale();
                                                                                                                                                                                                      gifImage.Save(dir + "sample.Grayscale.png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                                                                                                                                                  }

InsertBlock(タイトル:IGIFBlock)

新しいGIFブロックを入力すると、特定の位置にカスタマイズされたデータを追加できます。この方法では、カスタマイズブロックを望ましい場所に置くことができます。GIFイメージの位置、組織化および構造化における柔軟性を提供するイメージデータ

public void InsertBlock(int index, IGifBlock block)

Parameters

index int

ゼロベースの要素、どのブロックに挿入されるか。

block IGifBlock

GIFブロックを追加します。

OnPaletteChanged(イコロールパレット、イコロールパレット)

パレットが変更されたときに呼ばれます。

protected override void OnPaletteChanged(IColorPalette oldPalette, IColorPalette newPalette)

Parameters

oldPalette IColorPalette

古いパレット。

newPalette IColorPalette

新しいパレット。

OnPaletteChanging(イコロールパレット、イコロールパレット)

パレットが変わると呼ばれます。

protected override void OnPaletteChanging(IColorPalette oldPalette, IColorPalette newPalette)

Parameters

oldPalette IColorPalette

古いパレット。

newPalette IColorPalette

新しいパレット。

OrderBlocks()

GIF 規格に従って GIF ブロックを注文すると、適切な GIF が確保されます。レイアウトと標準の遵守:このプロセスは、ブロックは、規格によって定義された正しい順序で、さらに、いくつかの Aspose.Imaging.FileFormats.Gif.Blocks.GifGraphicsControlBlock を削除する可能性があります。GIFの仕様に従って、GIFの仕様に従って、結果の画像は正しく構造化され、GIFビューと互換性があります。応募

public void OrderBlocks()

RemoveBlock(IGIFブロック)

GIFブロックを削除すると、画像から特定のデータを削除し、清掃または画像構造を変更します. この方法では、望ましくないものを削除することができます。または不必要なブロック、効率的な保存のためにGIF画像を最適化します。機能は、画像から時代遅れの情報を削除し、保存します。誠実さと品質。

public void RemoveBlock(IGifBlock block)

Parameters

block IGifBlock

ブロックを取り除く。

Remarks

注:他の GifImage に追加しない場合は、ブロックを配置することを忘れないでください。

Resize(int、 int、 resizeType)

この Aspose.Imaging.Image をリサイクルします。

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

Parameters

newWidth int

新しい広さ。

newHeight int

新しい高さ。

resizeType ResizeType

リサイクルタイプ。

Examples

この例では、GIF画像をアップロードし、さまざまなリサイクル方法を使用してリサイクルします。

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

                                                                                        using (Aspose.Imaging.FileFormats.Gif.GifImage image = (Aspose.Imaging.FileFormats.Gif.GifImage)Aspose.Imaging.Image.Load(dir + "sample.gif"))
                                                                                        {
                                                                                            // Scale up by 2 times using Nearest Neighbour resampling.
                                                                                            image.Resize(image.Width* 2, image.Height* 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
                                                                                            image.Save(dir + "upsample.nearestneighbour.gif");
                                                                                        }

                                                                                        using (Aspose.Imaging.FileFormats.Gif.GifImage image = (Aspose.Imaging.FileFormats.Gif.GifImage)Aspose.Imaging.Image.Load(dir + "sample.gif"))
                                                                                        {
                                                                                            // Scale down by 2 times using Nearest Neighbour resampling.
                                                                                            image.Resize(image.Width / 2, image.Height / 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
                                                                                            image.Save(dir + "downsample.nearestneighbour.gif");
                                                                                        }

                                                                                        using (Aspose.Imaging.FileFormats.Gif.GifImage image = (Aspose.Imaging.FileFormats.Gif.GifImage)Aspose.Imaging.Image.Load(dir + "sample.gif"))
                                                                                        {
                                                                                            // Scale up by 2 times using Bilinear resampling.
                                                                                            image.Resize(image.Width* 2, image.Height* 2, Aspose.Imaging.ResizeType.BilinearResample);
                                                                                            image.Save(dir + "upsample.bilinear.gif");
                                                                                        }

                                                                                        using (Aspose.Imaging.FileFormats.Gif.GifImage image = (Aspose.Imaging.FileFormats.Gif.GifImage)Aspose.Imaging.Image.Load(dir + "sample.gif"))
                                                                                        {
                                                                                            // Scale down by 2 times using Bilinear resampling.
                                                                                            image.Resize(image.Width / 2, image.Height / 2, Aspose.Imaging.ResizeType.BilinearResample);
                                                                                            image.Save(dir + "downsample.bilinear.gif");
                                                                                        }

Resize(int、 int、 ImageResizeSettings)

この Aspose.Imaging.Image をリサイクルします。

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

Parameters

newWidth int

新しい広さ。

newHeight int

新しい高さ。

settings ImageResizeSettings

設定です。

Examples

この例ではGIF画像をアップロードし、さまざまなリサイクル設定を使用してリサイクルします。

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

                                                                                         Aspose.Imaging.ImageResizeSettings resizeSettings = new Aspose.Imaging.ImageResizeSettings();

                                                                                         // The adaptive algorithm based on weighted and blended rational function and lanczos3 interpolation.
                                                                                         resizeSettings.Mode = Aspose.Imaging.ResizeType.AdaptiveResample;

                                                                                         // The small rectangular filter
                                                                                         resizeSettings.FilterType = Aspose.Imaging.ImageFilterType.SmallRectangular;

                                                                                         // The number of colors in the palette.
                                                                                         resizeSettings.EntriesCount = 256;

                                                                                         // The color quantization is not used
                                                                                         resizeSettings.ColorQuantizationMethod = ColorQuantizationMethod.None;

                                                                                         // The euclidian method
                                                                                         resizeSettings.ColorCompareMethod = ColorCompareMethod.Euclidian;

                                                                                         using (Aspose.Imaging.Image image = (Aspose.Imaging.Image)Aspose.Imaging.Image.Load(dir + "sample.gif"))
                                                                                         {
                                                                                             Aspose.Imaging.FileFormats.Gif.GifImage gifImage = (Aspose.Imaging.FileFormats.Gif.GifImage)image;

                                                                                             // Scale down by 2 times using adaptive resampling.
                                                                                             gifImage.Resize(image.Width / 2, image.Height / 2, resizeSettings);

                                                                                             // Save to PNG
                                                                                             gifImage.Save(dir + "downsample.adaptive.png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                                         }

ResizeFullFrame(int、 int、 resizeType)

画像をリサイクルし、各ページの完全なフレームを考慮し、GIFは、潜在的なアーティファクトが現れるのを防ぎ、この方法は不可欠です。イメージの誠実さと品質を維持するため、特にアニメ化されたGIFやフレームのセクション。

public void ResizeFullFrame(int newWidth, int newHeight, ResizeType resizeType)

Parameters

newWidth int

新しい広さ。

newHeight int

新しい高さ。

resizeType ResizeType

リサイクルタイプ。

ResizeProportional(int、 int、 resizeType)

この方法は、幅と高さの両方を同じ要因によってスケールすることによって、画像を比例的にリサイクルします。 比例リサイクルは、各フレームを <コードクラス=“paramref”>new 幅と <コードクラス=“paramref”>new 幅と <コードクラス=“paramref”>new 幅の比率に従ってリサイクルします。

public void ResizeProportional(int newWidth, int newHeight, ResizeType resizeType)

Parameters

newWidth int

新しい広さ。

newHeight int

新しい高さ。

resizeType ResizeType

リサイクルタイプ。

Rotate(フラット、ボール、色)

この方法は、その中心点の周りにイメージを回転させます。角度で、画像を時計または対時計で回転させることができます。この回転は画像のプレゼンテーションを調整するのに役立ちます。内容を歪めずに調整する。

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

Parameters

angle float

ポジティブな値は時計的に回転します。

resizeProportionally bool

「真実」に設定すると、画像のサイズが変更されますが、その他の場合、サイズが触れられなくなり、単にinternal画像のコンテンツが回転します。

backgroundColor Color

背景の色。

RotateFlip(RotateFlipType)

独占的にアクティブフレームで回転、フリッピング、または両方を実行します。変換は、現在の画像のアクティブなフレームにのみ適用されます。連続で他のフレームの整合性を維持する。

public override void RotateFlip(RotateFlipType rotateFlipType)

Parameters

rotateFlipType RotateFlipType

ローテットフリップタイプ

Examples

この例では、GIF画像を積み重ね、90度の時刻形で回転し、オプション的に画像を水平および(または)垂直に振り回します。

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

                                                                                                                                             Aspose.Imaging.RotateFlipType[] rotateFlipTypes = new Aspose.Imaging.RotateFlipType[]
                                                                                                                                             {
                                                                                                                                                 Aspose.Imaging.RotateFlipType.Rotate90FlipNone,
                                                                                                                                                 Aspose.Imaging.RotateFlipType.Rotate90FlipX,
                                                                                                                                                 Aspose.Imaging.RotateFlipType.Rotate90FlipXY,
                                                                                                                                                 Aspose.Imaging.RotateFlipType.Rotate90FlipY,
                                                                                                                                             };

                                                                                                                                             foreach (Aspose.Imaging.RotateFlipType rotateFlipType in rotateFlipTypes)
                                                                                                                                             {
                                                                                                                                                 // Rotate, flip and save to the output file.
                                                                                                                                                 using (Aspose.Imaging.FileFormats.Gif.GifImage image = (Aspose.Imaging.FileFormats.Gif.GifImage)Aspose.Imaging.Image.Load(dir + "sample.gif"))
                                                                                                                                                 {
                                                                                                                                                     image.RotateFlip(rotateFlipType);
                                                                                                                                                     image.Save(dir + "sample." + rotateFlipType + ".png", new Aspose.Imaging.ImageOptions.PngOptions());
                                                                                                                                                 }
                                                                                                                                             }

SaveData(Stream)

データを保存します。

protected override void SaveData(Stream stream)

Parameters

stream Stream

データを保存するためのストリーム。

SetFrameTime(ウシュート)

各フレームの寿命をミリ秒で調整し、一貫したタイミングを確保します。画像の順序全体で、この方法は、表示時間を均一に設定します。それぞれのフレームで、アニメーションスピードの正確なコントロールを可能にします。この値を変更すると、すべてのフレームの遅延が再現されます。

public void SetFrameTime(ushort time)

Parameters

time ushort

フレーム時間はミリ秒で。

UpdateDimensions(int、 int)

画像のサイズを更新します。

protected override void UpdateDimensions(int newWidth, int newHeight)

Parameters

newWidth int

新しい画像の幅。

newHeight int

新しい画像の高さ。

 日本語