Class GifImage
이름 공간 : Aspose.Imaging.FileFormats.Gif 모임: Aspose.Imaging.dll (25.4.0)
그래픽 교환 형식 (GIF) 이미지 파일의 API는개발자는 압축 된 라스터 이미지를 처리하기위한 다양한 도구를 갖추고 있으며애니메이션 GIF. XMP 메타 데이터 처리, 색상 패널과 같은 기능을 제공설정, 배경 및 투명한 색상 제어, 오파시티 설정, resize,crop, 필터 응용, gamma 수정, 대조 조정, grayscale변환, 그리고 다른 형식으로 변환.이 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’ 모두 null이라면 기본 글로벌 팔레트가 사용됩니다.
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
firstFrame’는 null이 될 수 없습니다.
firstFrame’는 이미 다른 이미지에 속합니다.
<코드 클래스=“paramref”>globalPalette’ 지정된 항목은 2의 전력과 동일한 입력 계산을 포함해야합니다.
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 <= 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 <= 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
firstFrame’는 null이 될 수 없습니다.
firstFrame’는 이미 다른 이미지에 속합니다.
지정된 팔레트는 2의 전력과 동일한 입력 계산을 포함해야합니다.최소 팔레트 크기는 2이며 최대 256입니다.
GifImage(GifFrameBlock, IColorPalette, 바이트, 바이트, 바이트, 바이트)
Aspose.Imaging.FileFormats.Gif.GifImage 디자이너를 사용하여 쉽게 시작하십시오.간단한 방법으로, 당신은 쉽게 애니메이션 GIF를 만들 수 있습니다.firstFrame, globalPalette, paletteColorResolution, 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’ 모두 null이라면 기본 글로벌 팔레트가 사용됩니다.
isPaletteSorted
bool
‘진실’으로 설정하면 팔레트가 정렬됩니다. globalPalette’가 null이 아닌 경우 파라미터가 사용됩니다.
paletteColorResolution
byte
팔레트 색상 해상도. globalPalette’가 null이 아닌 경우 파라미터가 사용됩니다.
paletteBackgroundColorIndex
byte
패널 배경 색상 인덱스.
aspectRatio
byte
측면의 비율
hasTrailer
bool
‘진실’으로 설정하면 gif 이미지는 트레일러가 있지 않으면 스트림의 끝에 작성된 트레일러가 없습니다.
Exceptions
firstFrame’는 null이 될 수 없습니다.
firstFrame’는 이미 다른 이미지에 속합니다.
<코드 클래스=“paramref”>globalPalette’ 지정된 항목은 2의 전력과 동일한 입력 계산을 포함해야합니다.
Properties
ActiveFrame
이 속성으로 프레임을 관리하고 조작하여 부드러운 항해를 가능하게 하며,GIF 이미지 내에서 활성 프레임을 변경합니다.
public GifFrameBlock ActiveFrame { get; set; }
부동산 가치
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; }
부동산 가치
BackgroundColorIndex
이 속성을 사용하여 GIF 이미지의 배경 색상 인덱스를 제어합니다.일관성을 유지하거나 원하는 시각 효과를 얻기 위해 인덱스를 복구하십시오.
public byte BackgroundColorIndex { get; set; }
부동산 가치
Blocks
이 재산으로 GIF 블록에 쉽게 액세스할 수 있도록이미지의 기본 데이터 구조의 복구 및 조작.
public IGifBlock[] Blocks { get; }
부동산 가치
IGifBlock [ ] [ [ ]
FileFormat
이 속성으로 파일 형식을 쉽게 복구하십시오.이 속성은 당신의 출처입니다.당신의 파일의 형식을 식별하기 위해.당신의 작업 흐름에 무조건 통합,그것은 어떠한 혼란 없이 중요한 정보를 제공합니다.
public override FileFormat FileFormat { get; }
부동산 가치
HasBackgroundColor
이 속성은 GIF 이미지가 배경 색상을 포함하는지 여부를 결정합니다.사실, 그것은 이미지가 배경 색상을 포함한다는 것을 나타냅니다.
public override bool HasBackgroundColor { get; }
부동산 가치
HasTrailer
이 속성으로 GIF 파일에 트레일러의 존재를 관리하십시오.트레일러가 존재하는지 확인하거나 그것의 존재를 설정해야합니다.이 재산은 단순화됩니다.GIF 파일을 구조화하고 이 직관적인 기능과 일치하게 유지하십시오.
public bool HasTrailer { get; set; }
부동산 가치
HasTransparentColor
GIF 이미지의 활성 프레임이 투명한 색상을 포함하는지 여부를 결정합니다.이 숙박 시설은 이미지 내의 투명성을 확인하는 편리한 방법을 제공합니다.
public override bool HasTransparentColor { get; set; }
부동산 가치
ImageOpacity
이미지 내에서 활성 프레임의 무시성을 회복하고, 통찰력을 제공합니다그것의 투명성 수준.이 재산은 특히 이해에 유용합니다.이미지의 활성 프레임의 투명성 또는 무결성의 정도.
public override float ImageOpacity { get; }
부동산 가치
IsInterlaced
그림이 묶여 있는지 결정하여 충전 중에 그 표시에 영향을 미칩니다.재산은 이미지의 반영 행동에 대한 통찰력을 제공합니다, 필수적으로충전 전략을 최적화하고 전체 시청 경험을 향상시킵니다.
public bool IsInterlaced { get; }
부동산 가치
IsPaletteSorted
이 속성을 사용하여 GIF 이미지에서 팔레트의 분류를 제어하십시오.당신은 팔레트가 분류되었는지 또는 분류 행동을 설정하는지 확인해야합니다.재산은 당신의 팔레트 조직을 관리하는 간단한 방법을 제공합니다.GIF 파일
public bool IsPaletteSorted { get; set; }
부동산 가치
LoopsCount
이 속성을 사용하여 루프 계산을 쉽게 복구하십시오.GIF 이미지가 포함되어 있는 경우루프 정보, 이 재산은 루프 계산에 빠른 액세스를 제공, 가능당신은 당신의 GIF 파일에서 롤링 행동을 무조건 관리 할 수 있습니다.
public int LoopsCount { get; set; }
부동산 가치
PageCount
이와 함께 이미지 내에 포함된 페이지의 총 수를 복구합니다.간단한 재산. 이미지 콘텐츠의 범위를 신속하게 평가하는 데 이상적입니다.
public override int PageCount { get; }
부동산 가치
Pages
이 편리한 재산을 통해 이미지 내의 페이지에 액세스,필요한 경우 개별 페이지의 무조건 탐색 및 조작을 허용합니다.
public override Image[] Pages { get; }
부동산 가치
Image [ ] [ [ ]
PaletteColorResolutionBits
이 속성으로 GIF 이미지의 팔레트 색상 해상도를 관리합니다.팔레트에 색상을 나타내기 위해 사용되는 비트의 수, 얇은 제어를 제공색상 깊이와 이미지 품질.
public byte PaletteColorResolutionBits { get; set; }
부동산 가치
PixelAspectRatio
이 속성과 함께 GIF 이미지의 픽셀 측면 비율을 관리합니다.측면 비율은 정확한 제시를 보장하고 시각적 충성도를 유지합니다.
public byte PixelAspectRatio { get; set; }
부동산 가치
TransparentColor
GIF 이미지에서 활성 프레임의 투명한 색상을 복구합니다.이 속성당신은 투명으로 지정된 특정 색상에 액세스 할 수 있습니다.현재 활성화된 프레임 워크에서
public override Color TransparentColor { get; }
부동산 가치
XmpData
이 속성으로 XMP 메타 데이터를 관리하십시오.이 속성으로 기존 메타 데이터를 복구하고 있는지 여부또는 새로운 정보로 업데이트, 이 재산은 프로세스를 단순화합니다.귀하의 메타 데이터가 조직되고 접근 가능하며, 귀하의 파일이그들이 필요로 하는 관련 정보.
public override XmpPacketWrapper XmpData { get; set; }
부동산 가치
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 <= 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 <= 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 < 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
page’ is null.
AdjustBrightness(이트)
지정된 brightness의 매개 변수에 따라 이미지의 밝기를 조정합니다.이 방법은 전체 이미지의 밝기를 동일하게 변경하여 원하는 효과를 달성하기 위해 전체 밝기를 향상시키거나 감소시킵니다.
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
프레임 인덱스 : " + 프레임 인덱스
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(해군, 해군, 해군)
이미지의 Gamma 수정은 픽셀 값에 대한 비선형 조정을 적용합니다.빨간색에 대한 지정된 요소를 바탕으로 밝기를 향상시키거나 감소시킵니다.녹색, 그리고 파란 채널.이 방법은 색상 균형을 정화하는 데 도움이이미지의 밝기, 그것의 전체 외관과 시각 품질을 향상시킵니다.
public override void AdjustGamma(float gammaRed, float gammaGreen, float gammaBlue)
Parameters
gammaRed
float
붉은 채널 요소를 위한 Gamma
gammaGreen
float
녹색 채널 요소를 위한 Gamma
gammaBlue
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 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(듀얼)
Bradley의 적응형 경계 알고리즘을 사용하여 이미지의 이중화포괄적 인 이미지 경계는 그레이 스케일 이미지를 하나로 변환하는 방법입니다.이 알고리즘은 각 픽셀에 대한 지역 한계를 계산합니다.지정된 창 내의 주변 픽셀의 평균 강도.적응적으로 지역 픽셀 강도를 기반으로 한 경계선을 조정, 브래들리이 방법은 이미지를 통해 조명과 대조의 변화를 다루는 데 효과적입니다.
public override void BinarizeBradley(double brightnessDifference)
Parameters
brightnessDifference
double
픽셀 사이의 밝기 차이와 이 픽셀 주위에 중심된 픽셀의 s x s 창의 평균 차이.
BinarizeFixed(바이트)
사전 정의 한계를 가진 이미지의 바이너리화는 회색 또는 색상을 변환합니다.이미지가 바이너리 이미지로, 각 픽셀은 검정 또는 흰색으로 분류됩니다.그것의 강도 가치가 지정된 한계를 초과하는지 여부에 따라.
public override void BinarizeFixed(byte threshold)
Parameters
threshold
byte
해당 픽셀의 회색 값이 한계를 초과하는 경우, 255의 값이 그것에 부여됩니다, 0 그렇지 않으면.
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 경계를 사용하여 이미지의 이중화는 자동으로 사용되는 방법입니다.그레이스케일 이미지를 그레이스케일 이미지로 변환하기 위한 최적의 한계 값을 결정한다.이중 이미지. Otsu 경계 알고리즘은 그 경계를 계산합니다.픽셀 강도의 인트라 클래스 변화를 최소화하는 두 결과수업 (전구 및 배경).이 기술은 특히 유용한 경우최적의 한계 값은 알려지지 않으며 적응적으로 결정되어야 합니다.이미지의 히스토그램에
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(Dithering 방법, int, IColorPalette)
현재 이미지에 디트링을 적용합니다.이 프로세스는 이미지 품질을 향상시킵니다.색상 묶음을 줄이고 색상 전환을 개선하여 더 부드럽게겉모습
public override void Dither(DitheringMethod ditheringMethod, int bitsCount, IColorPalette customPalette)
Parameters
ditheringMethod
DitheringMethod
디트리밍 방법을 사용합니다.
bitsCount
int
마지막 비트는 디트링을 위해 계산됩니다.
customPalette
IColorPalette
Dithering을 위한 특정 팔레트.
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(오른쪽, FilterOptionsBase)
이미지의 지정된 영역에 특정 필터를 적용하여 시각을 향상시킵니다.품질 또는 원하는대로 모양을 변경합니다.이 방법은 선택적으로 처리됩니다.정의된 직경 내의 픽셀, 목표 조정이 이루어질 수 있도록동시에 주변 이미지 데이터의 무결성을 보존합니다.
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비트로 충전하고 그것을 저장하면Aspose.Imaging.DataStreamSupporter.Save(System.String) 방법, 출력 PNG 이미지 8 비트 / 픽셀이 생성됩니다.그것을 피하고 픽셀 당 1 비트로 PNG 이미지를 저장하려면이 방법을 사용하여 해당 저장 옵션을 얻고 통과하십시오.Aspose.Imaging.Image.Save(System.String,Aspose.Imaging.ImageOptionsBase) 방법은 두 번째 매개 변수입니다.
public override ImageOptionsBase GetOriginalOptions()
Returns
원본 파일 설정에 기초한 옵션.
Grayscale()
그림의 회색 표현으로 변환하면 색이 변환됩니다.그림은 색상 정보를 제거하고 동시에 보존함으로써 그레이 스케일 버전으로이 과정은 그림을 회색의 색조로 단순화하여 적합하게 만듭니다.다양한 응용 프로그램, 예를 들어 인쇄, 문서 처리 및 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 시청과 호환됩니다.응용 프로그램
public void OrderBlocks()
RemoveBlock(IGIF 블록)
GIF 블록을 제거하면 이미지에서 특정 데이터를 제거하여청소 또는 이미지 구조를 변경.이 방법은 원치 않는 것을 제거 할 수 있습니다또는 불필요한 블록, 효율적인 저장을 위해 GIF 이미지를 최적화합니다.기능은 이미지에서 오래된 정보를 제거하고 동시에 보존합니다.그것의 무결성과 품질.
public void RemoveBlock(IGifBlock block)
Parameters
block
IGifBlock
블록을 제거해야 합니다.
Remarks
참고: 다른 GifImage에 추가하지 않으면 블록을 배치하는 것을 잊지 마십시오.
Resize(인트, 인트, 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(이트, 이트, 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(인트, 인트, ResizeType)
각 페이지에 대한 전체 프레임을 고려하는 동안 이미지의 재설정GIF, 따라서 잠재적 인 유물의 출현을 방지합니다.이 방법은 필수적입니다.이미지의 무결성과 품질을 유지하기 위해, 특히애니메이션 GIF 또는 프레임의 순서.
public void ResizeFullFrame(int newWidth, int newHeight, ResizeType resizeType)
Parameters
newWidth
int
새로운 광도 입니다.
newHeight
int
새로운 높이 입니다.
resizeType
ResizeType
리세스 타입이죠.
ResizeProportional(인트, 인트, ResizeType)
이 방법은 동일한 요소에 따라 광도와 높이 모두를 측정하여 이미지의 측면 비율을 유지하면서 그것의 크기를 조정하여 이미지가 확장되거나 왜곡되지 않도록합니다.이 방법은 각 프레임을 newWidth’/width 및
newHeight’/height의 비율에 따라 측정합니다.
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(이트, 이트)
이미지 차원을 업데이트합니다.
protected override void UpdateDimensions(int newWidth, int newHeight)
Parameters
newWidth
int
새로운 이미지 폭.
newHeight
int
새로운 이미지 높이.