Class TiffImage
名称: Aspose.Imaging.FileFormats.Tiff アセンション: Aspose.Imaging.dll (25.4.0)
プロセス タグ イメージ ファイル フォーマット (TIFF) ラスター 画像 私たちの API で、提供さまざまな解像度および高度な編集能力のための包括的なサポートEXIFデータ操作やアルファチャンネルなど、スキャンされた画像の角度を標準化し、リサイクル、グレイスケールに変換、フィルター、ガマ修正、画像を適用パラメーターの調整は簡単です 複数のフレーム TIFF ファイルを操作しやすく、グラフィックパスを作成し、フォーマットを追加し、簡単に画像を異なるフォーマットに保存します。
[JsonObject(MemberSerialization.OptIn)]
public class TiffImage : RasterCachedMultipageImage, IDisposable, IObjectWithBounds, IRasterImageArgb32PixelLoader, IRasterImageRawDataLoader, IMultipageImageExt, IMultipageImage, IHasExifData, IHasXmpData, IHasMetadata
Inheritance
object ← DisposableObject ← DataStreamSupporter ← Image ← RasterImage ← RasterCachedImage ← RasterCachedMultipageImage ← TiffImage
Derived
Implements
IDisposable , IObjectWithBounds , IRasterImageArgb32PixelLoader , IRasterImageRawDataLoader , IMultipageImageExt , IMultipageImage , IHasExifData , IHasXmpData , IHasMetadata
相続人
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.ReleaseManagedResources() , RasterCachedMultipageImage.ResizeMain(int, int, ResizeType) , RasterCachedMultipageImage.RotateFlipMain(RotateFlipType) , RasterCachedMultipageImage.CropMain(int, int, int, int) , RasterCachedMultipageImage.SavePixelsInternalMain(Rectangle, int[]) , RasterCachedMultipageImage.CanDoAdjustments() , RasterCachedMultipageImage.GetPagesAsEnumerable() , 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.OnCached() , RasterCachedImage.OnPaletteChanged(IColorPalette, IColorPalette) , RasterCachedImage.IsCached , RasterImage.xmpData , 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.ReleaseManagedResources() , RasterImage.UpdateMetadata() , RasterImage.UpdateDimensions(int, int) , 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 , RasterImage.DataLoader , 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.UpdateContainer(Image) , Image.GetCanNotSaveMessage(ImageOptionsBase) , Image.GetFitRectangle(Rectangle) , Image.GetImage2Export(ImageOptionsBase, Rectangle, IImageExporter) , Image.GetFitRectangle(Rectangle, int[]) , Image.OnPaletteChanged(IColorPalette, IColorPalette) , Image.OnPaletteChanging(IColorPalette, IColorPalette) , Image.ReleaseManagedResources() , 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.timeout , DataStreamSupporter.CacheData() , DataStreamSupporter.Save() , DataStreamSupporter.Save(Stream) , DataStreamSupporter.Save(string) , DataStreamSupporter.Save(string, bool) , DataStreamSupporter.SaveData(Stream) , DataStreamSupporter.ReleaseManagedResources() , DataStreamSupporter.OnDataStreamContainerChanging(StreamContainer) , DataStreamSupporter.DataStreamContainer , DataStreamSupporter.IsCached , DisposableObject.Dispose() , DisposableObject.ReleaseManagedResources() , DisposableObject.ReleaseUnmanagedResources() , DisposableObject.VerifyNotDisposed() , DisposableObject.Disposed , object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
TIFF画像でPath Resourcesからグラフィックパスを作成します。
using (var image = (TiffImage)Image.Load("Bottle.tif"))
{
// Create the GraphicsPath using PathResources from TIFF image
var graphicsPath = PathResourceConverter.ToGraphicsPath(image.ActiveFrame.PathResources.ToArray(), image.ActiveFrame.Size);
var graphics = new Graphics(image);
// Draw red line and save the image
graphics.DrawPath(new Pen(Color.Red, 10), graphicsPath);
image.Save("BottleWithRedBorder.tif");
}
グラフィックパスを使用してパスリソースを作成します。
static void Main(string[] args)
{
using (var image = (TiffImage)Image.Load("Bottle.tif"))
{
// Create rectangular Figure for GraphicsPath
var figure = new Figure();
figure.AddShape(CreateBezierShape(100f, 100f, 500f, 100f, 500f, 1000f, 100f, 1000f));
// Create GraphicsPath using our Figure
var graphicsPath = new GraphicsPath();
graphicsPath.AddFigure(figure);
// Set PathResources using GraphicsPath
var pathResouze = PathResourceConverter.FromGraphicsPath(graphicsPath, image.Size);
image.ActiveFrame.PathResources = new List<pathresource>(pathResouze);
// Save the image
image.Save("BottleWithRectanglePath.tif");
}
}
private static BezierShape CreateBezierShape(params float[] coordinates)
{
var bezierPoints = CoordinatesToBezierPoints(coordinates).ToArray();
return new BezierShape(bezierPoints, true);
}
private static IEnumerable<pointf> CoordinatesToBezierPoints(float[] coordinates)
{
for (var coordinateIndex = 0; coordinateIndex < coordinates.Length; coordinateIndex += 2)
for (var index = 0; index < 3; index++)
yield return new PointF(coordinates[coordinateIndex], coordinates[coordinateIndex + 1]);
}</pointf></pathresource>
Constructors
TiffImage(TiffFrame)
Aspose.Imaging.FileFormats.Tiff.TiffImage クラスの新しいオブジェクトを開始し、フレームパラメーター この構築器は TiffImage の作成を容易にします。たとえば、開発者が充電または処理されるフレームを指定することを可能にし、アプリケーション内で Tiff イメージ処理の課題を簡素化します。
public TiffImage(TiffFrame frame)
Parameters
frame
TiffFrame
タイフフレームは、イメージをイニシアリズムする。
Examples
この例では、スクラッチからTIFF画像を作成し、ファイルに保存する方法を示しています。
string dir = "c:\\temp\\";
Aspose.Imaging.ImageOptions.TiffOptions createOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 8 bits for each color component.
createOptions.BitsPerSample = new ushort[] { 8, 8, 8 };
// Set the Big Endian byte order (Motorola)
createOptions.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.BigEndian;
// Set the LZW compression.
createOptions.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.Lzw;
// Set the RGB color model.
createOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
// All color components will be stored within a single plane.
createOptions.PlanarConfiguration = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPlanarConfigs.Contiguous;
// Create a TIFF Frame of 100x100 px.
// Note that you don't have to dispose a frame explicitly if it is included into TiffImage.
// When the container is disposed all frames will be disposed automatically.
Aspose.Imaging.FileFormats.Tiff.TiffFrame firstFrame = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(createOptions, 100, 100);
// Fill the entire frame with the blue-yellow gradient.
Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(firstFrame.Width, firstFrame.Height),
Aspose.Imaging.Color.Blue,
Aspose.Imaging.Color.Yellow);
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(firstFrame);
graphics.FillRectangle(gradientBrush, firstFrame.Bounds);
// Create a TIFF image.
using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = new Aspose.Imaging.FileFormats.Tiff.TiffImage(firstFrame))
{
tiffImage.Save(dir + "output.tif");
}
Exceptions
Tiff frame’ は空っぽではありません。
TiffImage(TiffFrame[])
Aspose.Imaging.FileFormats.Tiff.TiffImage クラスの新しい例を作成し、リストを提供します。パラメーターとしてのフレーム. この構築器は TiffImage の開始を可能にします。複数のフレームを持つオブジェクトで、効率的な処理と処理を促進するソフトウェアアプリケーション内のTIFF画像セクション。
public TiffImage(TiffFrame[] frames)
Parameters
frames
TiffFrame
( )
フレームです。
Examples
この例では、2 つのフレームで TIFF 画像を作成し、ファイルに保存する方法を示しています。
string dir = "c:\\temp\\";
// Options for the first frame
Aspose.Imaging.ImageOptions.TiffOptions createOptions1 = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 8 bits for each color component.
createOptions1.BitsPerSample = new ushort[] { 8, 8, 8 };
// Set the Big Endian byte order (Motorola)
createOptions1.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.BigEndian;
// Set the LZW compression.
createOptions1.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.Lzw;
// Set the RGB color model.
createOptions1.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
// All color components will be stored within a single plane.
createOptions1.PlanarConfiguration = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPlanarConfigs.Contiguous;
// Create the first TIFF frame of 100x100 px.
// Note that you don't have to dispose frames explicitly if they are included into TiffImage.
// When the container is disposed all frames will be disposed automatically.
Aspose.Imaging.FileFormats.Tiff.TiffFrame frame1 = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(createOptions1, 100, 100);
// Fill the first frame with the blue-yellow gradient.
Aspose.Imaging.Brushes.LinearGradientBrush gradientBrush = new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(frame1.Width, frame1.Height),
Aspose.Imaging.Color.Blue,
Aspose.Imaging.Color.Yellow);
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(frame1);
graphics.FillRectangle(gradientBrush, frame1.Bounds);
// Options for the first frame
Aspose.Imaging.ImageOptions.TiffOptions createOptions2 = new Aspose.Imaging.ImageOptions.TiffOptions(Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set 1 bit per pixel for a B/W image.
createOptions2.BitsPerSample = new ushort[] { 1 };
// Set the Little Endian byte order (Intel)
createOptions2.ByteOrder = Aspose.Imaging.FileFormats.Tiff.Enums.TiffByteOrder.LittleEndian;
// Set the CCITT Group 3 Fax compression.
createOptions2.Compression = Aspose.Imaging.FileFormats.Tiff.Enums.TiffCompressions.CcittFax3;
// Set the B/W color model where 0 is black, 1 is white.
createOptions2.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.MinIsBlack;
// Create the second TIFF frame of 200x200px.
Aspose.Imaging.FileFormats.Tiff.TiffFrame frame2 = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(createOptions2, 200, 200);
// Fill the second frame with the blue-yellow gradient.
// It will be automatically converted to the B/W format due to the corresponding settings of the frame.
Aspose.Imaging.Graphics graphics2 = new Aspose.Imaging.Graphics(frame2);
graphics2.FillRectangle(gradientBrush, frame2.Bounds);
// Create a TIFF image.
using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = new Aspose.Imaging.FileFormats.Tiff.TiffImage(
new Aspose.Imaging.FileFormats.Tiff.TiffFrame[] { frame1, frame2 }))
{
tiffImage.Save(dir + "output.mutliframe.tif");
}
Exceptions
フレーム
Properties
ActiveFrame
アクティブなフレームを無制限に管理し、ダイナミックなナビゲーションを促進し、指定されたコンテキスト内での操作:アプリケーションのインタラクティブ化マルチメディアコンテンツで効率的に、ユーザーの関与と生産性を向上させる。
public TiffFrame ActiveFrame { get; set; }
不動産価値
Examples
下記の例では、個々のラスター画像からミュリパージュTIFFを構成する方法を示しています。
Aspose.Imaging.ImageOptions.TiffOptions createTiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
createTiffOptions.Source = new Aspose.Imaging.Sources.FileCreateSource("c:\\temp\\multipage.tif", false);
createTiffOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
createTiffOptions.BitsPerSample = new ushort[] { 8, 8, 8 };
using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Image.Create(createTiffOptions, 100, 100))
{
// This is Font and Brush for drawing text on individual frames.
Aspose.Imaging.Font font = new Aspose.Imaging.Font("Arial", 64);
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.White);
// Create 5 frames
for (int i = 1; i <= 5; i++)
{
Aspose.Imaging.ImageOptions.PngOptions createPngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
createPngOptions.Source = new Aspose.Imaging.Sources.StreamSource(new System.IO.MemoryStream());
// Create a PNG image and draw the number of page on it.
Aspose.Imaging.FileFormats.Png.PngImage pngImage = (Aspose.Imaging.FileFormats.Png.PngImage)Image.Create(createPngOptions, 100, 100);
Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(pngImage);
gr.DrawString(i.ToString(), font, brush, 10, 10);
// Create a frame based on the PNG image.
Aspose.Imaging.FileFormats.Tiff.TiffFrame frame = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(pngImage);
// Add the frame to the TIFF image.
tiffImage.AddFrame(frame);
}
// The image was created with a single default frame. Let's remove it.
Aspose.Imaging.FileFormats.Tiff.TiffFrame activeFrame = tiffImage.ActiveFrame;
tiffImage.ActiveFrame = tiffImage.Frames[1];
tiffImage.RemoveFrame(0);
// Don't forget to dispose the frame if you won't add it to some other TiffImage
activeFrame.Dispose();
tiffImage.Save();
}
ByteOrder
TIFFファイルのバイトコマンドを一貫して組み合わせ、正確なコントロールを確保します。データ解釈:アプリケーションを柔軟に適応させるさまざまなファイル仕様、データ処理の互換性と効率性を向上させます。
public TiffByteOrder ByteOrder { get; set; }
不動産価値
ExifData
アクティブフレームに関連する EXIF データへのアクセスまたは変更は、無制限に、画像メタデータの正確なコントロール. アプリケーションの機能を向上させるこの機能を統合し、正確な保存とカスタマイズを確保する重要なイメージ情報
public ExifData ExifData { get; set; }
不動産価値
FileFormat
画像に関連するファイル形式の値を復元します. この属性は、画像メタデータの収集の重要な側面、ソフトウェアアプリケーションを可能にする画像データの形式を効率的に識別し、解釈する。
public override FileFormat FileFormat { get; }
不動産価値
Frames
Aspose.Imaging.FileFormats.Tiff.TiffFrame インスタンスの範囲を回収し、総合的なTIFFイメージ内の個々のフレームへのアクセスと操作。このレイヤーのパワーは、画像処理の作業流を簡素化し、正確性を確保します。視覚コンテンツのコントロールと最適化
public TiffFrame[] Frames { get; }
不動産価値
TiffFrame ( )
Examples
下記の例では、個々のラスター画像からミュリパージュTIFFを構成する方法を示しています。
Aspose.Imaging.ImageOptions.TiffOptions createTiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
createTiffOptions.Source = new Aspose.Imaging.Sources.FileCreateSource("c:\\temp\\multipage.tif", false);
createTiffOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
createTiffOptions.BitsPerSample = new ushort[] { 8, 8, 8 };
using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Image.Create(createTiffOptions, 100, 100))
{
// This is Font and Brush for drawing text on individual frames.
Aspose.Imaging.Font font = new Aspose.Imaging.Font("Arial", 64);
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.White);
// Create 5 frames
for (int i = 1; i <= 5; i++)
{
Aspose.Imaging.ImageOptions.PngOptions createPngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
createPngOptions.Source = new Aspose.Imaging.Sources.StreamSource(new System.IO.MemoryStream());
// Create a PNG image and draw the number of page on it.
Aspose.Imaging.FileFormats.Png.PngImage pngImage = (Aspose.Imaging.FileFormats.Png.PngImage)Image.Create(createPngOptions, 100, 100);
Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(pngImage);
gr.DrawString(i.ToString(), font, brush, 10, 10);
// Create a frame based on the PNG image.
Aspose.Imaging.FileFormats.Tiff.TiffFrame frame = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(pngImage);
// Add the frame to the TIFF image.
tiffImage.AddFrame(frame);
}
// The image was created with a single default frame. Let's remove it.
Aspose.Imaging.FileFormats.Tiff.TiffFrame activeFrame = tiffImage.ActiveFrame;
tiffImage.ActiveFrame = tiffImage.Frames[1];
tiffImage.RemoveFrame(0);
// Don't forget to dispose the frame if you won't add it to some other TiffImage
activeFrame.Dispose();
tiffImage.Save();
}
HasAlpha
画像にアルファチャネルがあるかどうかを決定し、重要な情報を提供します。rendering and compositing operations. この機能を統合して最適化します。視覚処理作業流、正確な表現と操作を確保する透明な要素
public override bool HasAlpha { get; }
不動産価値
Examples
下記の例では、TIFF画像をアップロードし、原材料データ形式およびアルファチャンネルに関する情報を印刷します。
string dir = "c:\\temp\\";
string fileName = dir + "sample.tif";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(fileName))
{
Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)image;
// If the active TIFF frame has alpha channel, then the entire TIFF image is considered to have alpha channel.
System.Console.WriteLine("ImageFile={0}, FileFormat={1}, HasAlpha={2}", fileName, tiffImage.RawDataFormat, tiffImage.HasAlpha);
int i = 0;
foreach (Aspose.Imaging.FileFormats.Tiff.TiffFrame frame in tiffImage.Frames)
{
System.Console.WriteLine("Frame={0}, FileFormat={1}, HasAlpha={2}", ++i, frame.RawDataFormat, frame.HasAlpha);
}
}
// The output may look like this:
// ImageFile=c:\temp\sample.tif, FileFormat=RgbIndexed1Bpp, used channels: 1, HasAlpha=False
// Frame=1, FileFormat=RgbIndexed1Bpp, used channels: 1, HasAlpha=False
// Frame=2, FileFormat=RgbIndexed1Bpp, used channels: 1, HasAlpha=False
HorizontalResolution
指定された Aspose.Imaging.Image の水平解像度をピクセルで回復します。インチごとに、正確な調整とパフォーマンスの提供を容易にします。基本的な画像メタデータは、努力なく、簡素化された画像処理を可能にします。改善されたユーザー体験のためのワークフロー
public override double HorizontalResolution { get; set; }
不動産価値
Examples
下記の例では、TIFF画像の水平/垂直解像度を設定する方法を示しています。
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)image;
// Get horizontal and vertical resolution of the TiffImage.
double horizontalResolution = tiffImage.HorizontalResolution;
double verticalResolution = tiffImage.VerticalResolution;
System.Console.WriteLine("The horizontal resolution, in pixels per inch: {0}", horizontalResolution);
System.Console.WriteLine("The vertical resolution, in pixels per inch: {0}", verticalResolution);
if (horizontalResolution != 96.0 || verticalResolution != 96.0)
{
// Use the SetResolution method for updating both resolution values in a single call.
System.Console.WriteLine("Set resolution values to 96 dpi");
tiffImage.SetResolution(96.0, 96.0);
System.Console.WriteLine("The horizontal resolution, in pixels per inch: {0}", tiffImage.HorizontalResolution);
System.Console.WriteLine("The vertical resolution, in pixels per inch: {0}", tiffImage.VerticalResolution);
}
}
Remarks
デフォルトでこの値は、異なるプラットフォームがスクリーン解像度を返すことができないため、常に96です。
PageCount
指定された文書内のページの総数を回収し、マルチページコンテンツの効率的なナビゲーションと管理。機能性は、ユーザー体験を向上させ、無線アクセスを可能にします。総合的な文書構造
public override int PageCount { get; }
不動産価値
Pages
文書のページに無線にアクセスし、ダイナミックなナビゲーションを可能にし、コンテンツ構造内での操作 アプリケーションを効率的に強化個々のページへのアクセス、簡素化された文書処理を促進し、ユーザーインタラクションの向上
public override Image[] Pages { get; }
不動産価値
Image ( )
PremultiplyComponents
コンポーネントが事前複製を必要としているかどうかを示し、効率的な処理を確保する。ビジュアル・エレメントのプロセスを改善し、この財産を掘り起こし、最適なパフォーマンスのためのグラフィックワークフローを簡素化する。
public override bool PremultiplyComponents { get; set; }
不動産価値
Examples
次の例では、新しい TIFF イメージを作成し、指定された半透明ピクセルを保存し、その後、これらのピクセルを充電し、最終色をプレミュレート形式で取得します。
int imageWidth = 3;
int imageHeight = 2;
Aspose.Imaging.Color[] colors = new Aspose.Imaging.Color[]
{
Aspose.Imaging.Color.FromArgb(127, 255, 0, 0),
Aspose.Imaging.Color.FromArgb(127, 0, 255, 0),
Aspose.Imaging.Color.FromArgb(127, 0, 0, 255),
Aspose.Imaging.Color.FromArgb(127, 255, 255, 0),
Aspose.Imaging.Color.FromArgb(127, 255, 0, 255),
Aspose.Imaging.Color.FromArgb(127, 0, 255, 255),
};
Aspose.Imaging.ImageOptions.TiffOptions createOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.TiffDeflateRgba);
createOptions.Source = new Aspose.Imaging.Sources.StreamSource(new System.IO.MemoryStream(), true);
using (Aspose.Imaging.FileFormats.Tiff.TiffImage image = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Aspose.Imaging.Image.Create(createOptions, imageWidth, imageHeight))
{
// Save pixels for the whole image.
image.SavePixels(image.Bounds, colors);
// The pixels are stored in the original image in the non-premultiplied form.
// Need to specify the corresponding option explicitly to obtain premultiplied color components.
// The premultiplied color components are calculated by the formulas:
// red = original_red * alpha / 255;
// green = original_green * alpha / 255;
// blue = original_blue * alpha / 255;
image.PremultiplyComponents = true;
Aspose.Imaging.Color[] premultipliedColors = image.LoadPixels(image.Bounds);
for (int i = 0; i < colors.Length; i++)
{
System.Console.WriteLine("Original color: {0}", colors[i].ToString());
System.Console.WriteLine("Premultiplied color: {0}", premultipliedColors[i].ToString());
}
}
//The output will look like this:
//Original color: Color [A=127, R=255, G=0, B=0]
//Premultiplied color: Color [A=127, R=127, G=0, B=0]
//Original color: Color [A=127, R=0, G=255, B=0]
//Premultiplied color: Color [A=127, R=0, G=127, B=0]
//Original color: Color [A=127, R=0, G=0, B=255]
//Premultiplied color: Color [A=127, R=0, G=0, B=127]
//Original color: Color [A=127, R=255, G=255, B=0]
//Premultiplied color: Color [A=127, R=127, G=127, B=0]
//Original color: Color [A=127, R=255, G=0, B=255]
//Premultiplied color: Color [A=127, R=127, G=0, B=127]
//Original color: Color [A=127, R=0, G=255, B=255]
//Premultiplied color: Color [A=127, R=0, G=127, B=127]
VerticalResolution
指定された Aspose.Imaging.Image の垂直解像度にアクセスするインチ、正確な調整と最適化を可能にします。画像データは、画像処理の作業流を簡素化し、あなたのアプリケーションにおける優れた品質とパフォーマンス
public override double VerticalResolution { get; set; }
不動産価値
Examples
下記の例では、TIFF画像の水平/垂直解像度を設定する方法を示しています。
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)image;
// Get horizontal and vertical resolution of the TiffImage.
double horizontalResolution = tiffImage.HorizontalResolution;
double verticalResolution = tiffImage.VerticalResolution;
System.Console.WriteLine("The horizontal resolution, in pixels per inch: {0}", horizontalResolution);
System.Console.WriteLine("The vertical resolution, in pixels per inch: {0}", verticalResolution);
if (horizontalResolution != 96.0 || verticalResolution != 96.0)
{
// Use the SetResolution method for updating both resolution values in a single call.
System.Console.WriteLine("Set resolution values to 96 dpi");
tiffImage.SetResolution(96.0, 96.0);
System.Console.WriteLine("The horizontal resolution, in pixels per inch: {0}", tiffImage.HorizontalResolution);
System.Console.WriteLine("The vertical resolution, in pixels per inch: {0}", tiffImage.VerticalResolution);
}
}
Remarks
デフォルトでこの値は、異なるプラットフォームがスクリーン解像度を返すことができないため、常に96です。
Methods
Add(TiffImage)
指定された画像のフレームを現在のフレームに無線に追加し、コンテンツを強化し、構成の柔軟性を向上させる。この方法は、フレームマネジメントとあなたの内部の操作を簡素化します。アプリケーションにより、マルチフレーム画像の効率的な処理が容易になります。
public void Add(TiffImage image)
Parameters
image
TiffImage
ソース画像です。
AddFrame(TiffFrame)
指定されたフレームを無線に画像に挿入し、その内容を拡大します。この方法を使用して、画像の構成と管理を改善し、アプリ内のマルチフレーム画像の効率的な処理を可能にします。
public void AddFrame(TiffFrame frame)
Parameters
frame
TiffFrame
フレームを追加する。
Examples
下記の例では、個々のラスター画像からミュリパージュTIFFを構成する方法を示しています。
Aspose.Imaging.ImageOptions.TiffOptions createTiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
createTiffOptions.Source = new Aspose.Imaging.Sources.FileCreateSource("c:\\temp\\multipage.tif", false);
createTiffOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
createTiffOptions.BitsPerSample = new ushort[] { 8, 8, 8 };
using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Image.Create(createTiffOptions, 100, 100))
{
// This is Font and Brush for drawing text on individual frames.
Aspose.Imaging.Font font = new Aspose.Imaging.Font("Arial", 64);
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.White);
// Create 5 frames
for (int i = 1; i <= 5; i++)
{
Aspose.Imaging.ImageOptions.PngOptions createPngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
createPngOptions.Source = new Aspose.Imaging.Sources.StreamSource(new System.IO.MemoryStream());
// Create a PNG image and draw the number of page on it.
Aspose.Imaging.FileFormats.Png.PngImage pngImage = (Aspose.Imaging.FileFormats.Png.PngImage)Image.Create(createPngOptions, 100, 100);
Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(pngImage);
gr.DrawString(i.ToString(), font, brush, 10, 10);
// Create a frame based on the PNG image.
Aspose.Imaging.FileFormats.Tiff.TiffFrame frame = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(pngImage);
// Add the frame to the TIFF image.
tiffImage.AddFrame(frame);
}
// The image was created with a single default frame. Let's remove it.
Aspose.Imaging.FileFormats.Tiff.TiffFrame activeFrame = tiffImage.ActiveFrame;
tiffImage.ActiveFrame = tiffImage.Frames[1];
tiffImage.RemoveFrame(0);
// Don't forget to dispose the frame if you won't add it to some other TiffImage
activeFrame.Dispose();
tiffImage.Save();
}
AddFrames(TiffFrame[])
フレームの範囲を無線にイメージに統合し、その内容を豊かにし、多様性:この方法を使用して画像の構成と管理を改善し、アプリ内のマルチフレーム画像の効率的な処理を可能にします。
public void AddFrames(TiffFrame[] frames)
Parameters
frames
TiffFrame
( )
フレームは追加する
AddPage(RasterImage)
既存の画像に新しいページを入力し、そのコンテンツを拡大この方法を使用して、文書の構成を改善し、管理、アプリ内の複数のページ画像の効率的な処理を可能にします。
public virtual void AddPage(RasterImage page)
Parameters
page
RasterImage
追加するページです。
Exceptions
page’ is null.
AdjustBrightness(インタ)
画像に brightness’ の調整を実施し、全体的な照明レベルのテモディフィクションを可能にします. この方法を画像処理のワークフローに組み込んで、視覚性を向上させ、アプリ内の画像の視覚品質を向上させます。
public override void AdjustBrightness(int brightness)
Parameters
brightness
int
明るさの価値
Examples
次の例では、TIFF画像の明るさ修正を実行します。
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)image;
// Set the brightness value. The accepted values of brightness are in the range [-255, 255].
tiffImage.AdjustBrightness(50);
tiffImage.Save(dir + "sample.AdjustBrightness.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
AdjustContrast(フラット)
Aspose.Imaging.Image の対比を向上させ、光と暗い領域の間の違いを強化する。機能性 画像の視覚的明確性と全体的な品質を向上させるあなたの応募中。
public override void AdjustContrast(float contrast)
Parameters
contrast
float
対照値(範囲内(100、100)
Examples
次の例では、TIFF画像の対照修正を実行します。
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)image;
// Set the contrast value. The accepted values of contrast are in the range [-100f, 100f].
tiffImage.AdjustContrast(50f);
tiffImage.Save(dir + "sample.AdjustContrast.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
AdjustGamma(フラット)
画像にガマ修正を適用し、ピクセル強度を調整する望ましい色のバランス. この方法を画像処理に組み込む視覚の質を向上させ、その後の精度を向上させるためのワークフローアプリケーション内の分析または表示タスク
public override void AdjustGamma(float gamma)
Parameters
gamma
float
レッド・グリーン・ブルー・チャンネルのGAMMA
Examples
次の例では、TIFF画像のガマ修正を実行します。
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)image;
// Set gamma coefficient for red, green and blue channels.
tiffImage.AdjustGamma(2.5f);
tiffImage.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
下記の例では、TIFF画像のガマ修正を実行し、色のコンポーネントに異なるコーヒーを適用します。
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)image;
// Set individual gamma coefficients for red, green and blue channels.
tiffImage.AdjustGamma(1.5f, 2.5f, 3.5f);
tiffImage.Save(dir + "sample.AdjustGamma.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
AlignResolutions()
AlignResolutionsの手助け方法を実施して、地平線と垂直解像度、画像サイズの統一性を確保する。解像度調和による画像処理作業流を簡素化するパラメーター、さまざまなプラットフォームで視覚品質と一貫性を最適化し、装置
public void AlignResolutions()
BinarizeBradley(二重、 int)
ブラッドリーの適応範囲を採用するイメージにバイナリ化を実施アルゴリズムは、統合的なイメージの範囲で、このアプローチはダイナミックに計算します。イメージの近所に基づく地元の限界、適応性の向上異なる照明条件を確保し、その後の強力な分割を確保する。あなたのアプリケーション内での作業の処理
public override void BinarizeBradley(double brightnessDifference, int windowSize)
Parameters
brightnessDifference
double
ピクセルの明るさの違いと、s x s ピクセルのウィンドウの平均このピクセルを中心に
windowSize
int
このピクセルの周りに焦点を当てたピクセルのサイズの s x s ウィンドウ
Examples
次の例では、ブラッドリーの適応範囲アルゴリズムと指定されたウィンドウサイズのTIFF画像をバイナリ化します。
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)image;
// Binarize the image with a brightness difference of 5. The brightness is a difference between a pixel and the average of an 10 x 10 window of pixels centered around this pixel.
tiffImage.BinarizeBradley(5, 10);
tiffImage.Save(dir + "sample.BinarizeBradley5_10x10.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
BinarizeFixed(ビート)
既定の範囲を使用して画像にバイナリ化を適用し、それを変換します。異なる前面および背景地域を持つバイナリーイメージ。画像処理のワークフローへの方法 セグメントと機能を容易にするために抽出作業、画像分析の正確性と効率性を向上させるあなたの応募
public override void BinarizeFixed(byte threshold)
Parameters
threshold
byte
ピクセルの関連するグレー値が限界を超える場合、255はそれに割り当てられますが、0は別に割り当てられます。
Examples
次の例では、事前に定義された範囲を持つTIFF画像をバイナリ化します. バイナリ化された画像には、黒と白の2色のみが含まれています。
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)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.
tiffImage.BinarizeFixed(127);
tiffImage.Save(dir + "sample.BinarizeFixed.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
BinarizeOtsu()
Otsu の範囲を使用して、自動的に画像にバイナリ化を行います。画像のヒストグラムに基づいて最適な限界値を決定する。この方法は、効果的なセグメントを達成するために、あなたの画像処理ワークフローに入ります。特性抽出、画像分析の正確性と信頼性を向上させる応募内の課題
public override void BinarizeOtsu()
Examples
次の例では、TIFF 画像を Otsu 範囲でバイナリ化します. バイナリ化された画像には、黒と白の 2 色のみが含まれています。
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)image;
// Binarize the image with Otsu thresholding.
tiffImage.BinarizeOtsu();
tiffImage.Save(dir + "sample.BinarizeOtsu.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
Crop(Rectangle)
特定の直角地域を使用して画像を栽培し、正確な選択を可能にします。望ましいコンテンツ. この方法を画像処理ワークフローに統合する効果的に望ましくない領域を取り除き、重要な細部に焦点を当て、全体的な明確さとイメージの構成。
public override void Crop(Rectangle rectangle)
Parameters
rectangle
Rectangle
直角です。
Examples
次の例では、TIFF画像を収穫します. 収穫の領域は Aspose.Imaging.Rectangle を介して指定されます。
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)image;
// Crop the image. The cropping area is the rectangular central area of the image.
Aspose.Imaging.Rectangle area = new Aspose.Imaging.Rectangle(tiffImage.Width / 4, tiffImage.Height / 4, tiffImage.Width / 2, tiffImage.Height / 2);
tiffImage.Crop(area);
// Save the cropped image to PNG
tiffImage.Save(dir + "sample.Crop.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
Crop(int、 int、 int、 int、 int)
左、右、上に変動を指定することによって画像を掘り起こし、この方法は、望ましい部分の正確な選択を可能にします。画像は、望ましくない領域の効率的な除去を促進し、焦点を当てる。重要なコンテンツ. この機能を画像処理に統合するパイプラインは、アプリケーション内で必要に応じて明確性と構成を向上させます。
public override void Crop(int leftShift, int rightShift, int topShift, int bottomShift)
Parameters
leftShift
int
左転換。
rightShift
int
正しい転換です。
topShift
int
トップ転換
bottomShift
int
下の転換。
Examples
次の例では、TIFF画像を収穫します 収穫の領域は、左、上、右、下のマージンによって指定されます。
string dir = @"c:\temp\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)image;
// Crop again. Set a margin of 10% of the image size.
int horizontalMargin = tiffImage.Width / 10;
int verticalMargin = tiffImage.Height / 10;
tiffImage.Crop(horizontalMargin, horizontalMargin, verticalMargin, verticalMargin);
// Save the cropped image to PNG.
tiffImage.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
下記の例では、TIFF画像を積み重ね、異なるパレット深さを用いて範囲と流れのダイトリングを実行します。
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)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.
tiffImage.Dither(Aspose.Imaging.DitheringMethod.ThresholdDithering, 4, null);
tiffImage.Save(dir + "sample.ThresholdDithering4.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)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.
tiffImage.Dither(Aspose.Imaging.DitheringMethod.FloydSteinbergDithering, 1, null);
tiffImage.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
下記の例では、TIFF画像にさまざまなタイプのフィルターが適用されます。
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)image;
// Apply a median filter with a rectangle size of 5 to the entire image.
tiffImage.Filter(tiffImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.MedianFilterOptions(5));
tiffImage.Save(dir + "sample.MedianFilter.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)image;
// Apply a bilateral smoothing filter with a kernel size of 5 to the entire image.
tiffImage.Filter(tiffImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.BilateralSmoothingFilterOptions(5));
tiffImage.Save(dir + "sample.BilateralSmoothingFilter.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)image;
// Apply a Gaussian blur filter with a radius of 5 and a sigma value of 4.0 to the entire image.
tiffImage.Filter(tiffImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.GaussianBlurFilterOptions(5, 4.0));
tiffImage.Save(dir + "sample.GaussianBlurFilter.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)image;
// Apply a Gauss-Wiener filter with a radius of 5 and a smooth value of 4.0 to the entire image.
tiffImage.Filter(tiffImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.GaussWienerFilterOptions(5, 4.0));
tiffImage.Save(dir + "sample.GaussWienerFilter.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)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.
tiffImage.Filter(tiffImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.MotionWienerFilterOptions(10, 1.0, 90.0));
tiffImage.Save(dir + "sample.MotionWienerFilter.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)image;
// Apply a sharpen filter with a kernel size of 5 and a sigma value of 4.0 to the entire image.
tiffImage.Filter(tiffImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.SharpenFilterOptions(5, 4.0));
tiffImage.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
オリジナルファイル設定に基づくオプション
Exceptions
画像から抽出できるオリジナルオプションはありません。
Grayscale()
イメージをグレイスケールの表現に変換し、そのイメージをグレイスケールの表現に変換する。単チャネル画像で、それぞれのピクセルが強度を表しています。あなたの画像処理パイプラインに分析を簡素化し、改善するためにグレイスケールベースのアルゴリズムとの互換性、さまざまなコンピュータを容易にするビジョンとイメージ分析の課題は、あなたのアプリケーション内です。
public override void Grayscale()
Examples
下記の例では、色のTIFF画像をグレイスケールの表現に変換します。グレイスケール画像は、グレイの色のみで構成され、強度情報のみを持ちます。
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)image;
tiffImage.Grayscale();
tiffImage.Save(dir + "sample.Grayscale.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
InsertFrame(トップ > TiffFrame)
新しいフレームをフレームセクション内の指定インデックスに挿入し、フレームの整理を正確にコントロールします. この方法を使用してフレームを管理します。効果的な順序、ダイナミックな操作とイメージの組織を促進するあなたのアプリ内のコンテンツ
public void InsertFrame(int index, TiffFrame frameToInsert)
Parameters
index
int
フレームリストにおける新しいフレームのインデックス
frameToInsert
TiffFrame
フレームを入力する。
NormalizeAngle(ボール、色)
スキャンされたテキストドキュメントのために特別に設計された NormalizeAngle メソッドを使用するスケートスキャンを修正し、正確な調和を確保します。この機能をテキスト処理ワークフローに統合して、文書の読みやすさと品質、テキスト認識における全体的な効率の向上分析の課題この方法では、Aspose.Imaging.RasterImage.GetSkewAngleとAspose.Imaging.FileFormats.Tiff.TiffImage.Rotate(System.Single、System.Boolean、Aspose.Imaging.Color)の方法を使用します。
public override void NormalizeAngle(bool resizeProportionally, Color backgroundColor)
Parameters
resizeProportionally
bool
「真実」に設定された場合、画像のサイズは回転直角(角点)プロジェクションに従って変更され、その他の場合、サイズが触れず、内部画像のみが回転されます。
backgroundColor
Color
背景の色。
ReleaseManagedResources()
管理されたリソースをリリースします. 管理されていないリソースがリリースされていないことを確認してください. リソースはすでにリリースされているかもしれません。
protected override void ReleaseManagedResources()
RemoveFrame(インタ)
インデックスによって特定されたフレームを画像の順序から無力に削除し、アプリケーション内でフレームマネジメントを簡素化します。フレーム操作における効率性と正確性を向上させるための機能性無形の組織とイメージコンテンツのプレゼンテーションを促進する。
public TiffFrame RemoveFrame(int index)
Parameters
index
int
フレームインデックスが削除されます。
Returns
削除されたフレーム。
Examples
下記の例では、個々のラスター画像からミュリパージュTIFFを構成する方法を示しています。
Aspose.Imaging.ImageOptions.TiffOptions createTiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
createTiffOptions.Source = new Aspose.Imaging.Sources.FileCreateSource("c:\\temp\\multipage.tif", false);
createTiffOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
createTiffOptions.BitsPerSample = new ushort[] { 8, 8, 8 };
using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Image.Create(createTiffOptions, 100, 100))
{
// This is Font and Brush for drawing text on individual frames.
Aspose.Imaging.Font font = new Aspose.Imaging.Font("Arial", 64);
Aspose.Imaging.Brushes.SolidBrush brush = new Aspose.Imaging.Brushes.SolidBrush(Aspose.Imaging.Color.White);
// Create 5 frames
for (int i = 1; i <= 5; i++)
{
Aspose.Imaging.ImageOptions.PngOptions createPngOptions = new Aspose.Imaging.ImageOptions.PngOptions();
createPngOptions.Source = new Aspose.Imaging.Sources.StreamSource(new System.IO.MemoryStream());
// Create a PNG image and draw the number of page on it.
Aspose.Imaging.FileFormats.Png.PngImage pngImage = (Aspose.Imaging.FileFormats.Png.PngImage)Image.Create(createPngOptions, 100, 100);
Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(pngImage);
gr.DrawString(i.ToString(), font, brush, 10, 10);
// Create a frame based on the PNG image.
Aspose.Imaging.FileFormats.Tiff.TiffFrame frame = new Aspose.Imaging.FileFormats.Tiff.TiffFrame(pngImage);
// Add the frame to the TIFF image.
tiffImage.AddFrame(frame);
}
// The image was created with a single default frame. Let's remove it.
Aspose.Imaging.FileFormats.Tiff.TiffFrame activeFrame = tiffImage.ActiveFrame;
tiffImage.ActiveFrame = tiffImage.Frames[1];
tiffImage.RemoveFrame(0);
// Don't forget to dispose the frame if you won't add it to some other TiffImage
activeFrame.Dispose();
tiffImage.Save();
}
Remarks
注:他の TiffImage に追加しない場合はフレームを配置することを忘れないでください。
RemoveFrame(TiffFrame)
画像の順序から指定されたフレームを効率的に削除し、アプリ内のフレームマネジメントを簡素化します この機能を統合するフレーム操作における正確性と柔軟性を向上させ、シームなしを確保する。イメージコンテンツの組織およびプレゼンテーション
public void RemoveFrame(TiffFrame frame)
Parameters
frame
TiffFrame
取り除くためのフレーム。
Remarks
注:他の TiffImage に追加しない場合はフレームを配置することを忘れないでください。
RemoveMetadata()
この画像の例のメタデータを削除して、これらの Aspose.Imaging.Xmp.IHasXMPData.xmp Data と __ WL15__ .Exif.IhasExivDat.ExIFDate 値を設定します。 ゼロ.
public override void RemoveMetadata()
ReplaceFrame(トップ > TiffFrame)
指定された位置のフレームを別のフレームで無線に置き換え、イメージセクション内のダイナミックフレーム管理を促進する。フレーム操作における柔軟性と正確性を向上させる方法アプリ内の画像コンテンツの最適な組織およびプレゼンテーション。
public TiffFrame ReplaceFrame(int index, TiffFrame frameToReplace)
Parameters
index
int
ゼロベースのフレームポジション
frameToReplace
TiffFrame
置き換えるフレーム。
Returns
削除されたフレーム。
Remarks
注:他の TiffImage に追加しない場合はフレームを配置することを忘れないでください。
Resize(int、 int、 resizeType)
特定のリサイクルタイプに従って画像をリサイクルし、柔軟性を促進します。画像のサイズを調整し、側面比率を維持したり、特定のアプリケーションをスケールアルゴリズム この方法を画像処理ワークフローに組み込むあなたのアプリケーション内のリサイクル作業の正確なコントロールを達成するために。
public override void Resize(int newWidth, int newHeight, ResizeType resizeType)
Parameters
newWidth
int
新しい広さ。
newHeight
int
新しい高さ。
resizeType
ResizeType
リサイクルタイプ。
Examples
この例では、TIFF画像を積み重ね、さまざまなリサイクル方法を使用してリサイクルします。
string dir = "c:\\temp\\";
using (Aspose.Imaging.FileFormats.Tiff.TiffImage image = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
// Scale up by 2 times using Nearest Neighbour resampling.
image.Resize(image.Width* 2, image.Height* 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
// Save to PNG with default options.
image.Save(dir + "upsample.nearestneighbour.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Tiff.TiffImage image = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
// Scale down by 2 times using Nearest Neighbour resampling.
image.Resize(image.Width / 2, image.Height / 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
// Save to PNG with default options.
image.Save(dir + "downsample.nearestneighbour.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Tiff.TiffImage image = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
// Scale up by 2 times using Bilinear resampling.
image.Resize(image.Width* 2, image.Height* 2, Aspose.Imaging.ResizeType.BilinearResample);
// Save to PNG with default options.
image.Save(dir + "upsample.bilinear.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Tiff.TiffImage image = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
// Scale down by 2 times using Bilinear resampling.
image.Resize(image.Width / 2, image.Height / 2, Aspose.Imaging.ResizeType.BilinearResample);
// Save to PNG with default options.
image.Save(dir + "downsample.bilinear.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
Resize(int、 int、 ImageResizeSettings)
特定の設定に基づいて画像のサイズを調整し、正確性を可能にします。次元のコントロール、側面比率、スケーリング行動。あなたの画像処理ワークフローへの方法をカスタマイズされたリサイクルを達成するために応募の具体的な要件に適応した作業
public override void Resize(int newWidth, int newHeight, ImageResizeSettings settings)
Parameters
newWidth
int
新しい広さ。
newHeight
int
新しい高さ。
settings
ImageResizeSettings
リサイクル設定
Examples
この例では、TIFF画像をアップロードし、さまざまなリサイクル設定を使用してリサイクルします。
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.tif"))
{
Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)image;
// Scale down by 2 times using adaptive resampling.
tiffImage.Resize(image.Width / 2, image.Height / 2, resizeSettings);
// Save to PNG
tiffImage.Save(dir + "downsample.adaptive.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
ResizeHeightProportionally(リズム、リズム)
画像の高さを比例的に調整し、その外観を維持する。連続的な視覚的完全性のための比率. この方法を使用してダイナミックにリサイクルアプリ内の画像で、さまざまなプラットフォームで最適な表示を確保コンテンツの品質を損なうことなく、
public override void ResizeHeightProportionally(int newHeight, ResizeType resizeType)
Parameters
newHeight
int
新しい高さ。
resizeType
ResizeType
リサイクルの種類
Examples
この例では、TIFF画像を積み重ね、さまざまなリサイクル方法を使用して比例的にリサイクルします。高さだけが指定され、幅が自動的に計算されます。
string dir = "c:\\temp\\";
using (Aspose.Imaging.FileFormats.Tiff.TiffImage image = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
// Scale up by 2 times using Nearest Neighbour resampling.
image.ResizeHeightProportionally(image.Height* 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
// Save to PNG with the default options.
image.Save(dir + "upsample.nearestneighbour.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Tiff.TiffImage image = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
// Scale down by 2 times using Nearest Neighbour resampling.
image.ResizeHeightProportionally(image.Height / 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
// Save to PNG with the default options.
image.Save(dir + "downsample.nearestneighbour.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Tiff.TiffImage image = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
// Scale up by 2 times using Bilinear resampling.
image.ResizeHeightProportionally(image.Height* 2, Aspose.Imaging.ResizeType.BilinearResample);
// Save to PNG with the default options.
image.Save(dir + "upsample.bilinear.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Tiff.TiffImage image = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
// Scale down by 2 times using Bilinear resampling.
image.ResizeHeightProportionally(image.Height / 2, Aspose.Imaging.ResizeType.BilinearResample);
// Save to PNG with the default options.
image.Save(dir + "downsample.bilinear.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
ResizeProportional(int、 int、 resizeType)
この方法を使用してアプリケーション内の画像をダイナミックにスケールし、コンテンツの整合性の一貫した視覚的表現を確保します。
public void ResizeProportional(int newWidth, int newHeight, ResizeType resizeType)
Parameters
newWidth
int
新しい広さ。
newHeight
int
新しい高さ。
resizeType
ResizeType
リサイクルタイプ。
ResizeWidthProportionally(リズム、リズム)
画像の幅を調整し、その側面比率を維持し、最適なビジュアルプレゼンテーションのための相対的なリサイクル. この方法を使用して、アプリ内の画像をダイナミックにスケールし、一貫性とさまざまなディスプレイコンテキストを通じてエステティックに快適なレンダリング。
public override void ResizeWidthProportionally(int newWidth, ResizeType resizeType)
Parameters
newWidth
int
新しい広さ。
resizeType
ResizeType
リサイクルの種類
Examples
この例では、TIFF画像を積み重ね、さまざまなリサイクル方法を使用して比例的にリサイクルします。幅だけが指定され、高さが自動的に計算されます。
string dir = "c:\\temp\\";
using (Aspose.Imaging.FileFormats.Tiff.TiffImage image = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
// Scale up by 2 times using Nearest Neighbour resampling.
image.ResizeWidthProportionally(image.Width* 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
// Save to PNG with the default options.
image.Save(dir + "upsample.nearestneighbour.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Tiff.TiffImage image = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
// Scale down by 2 times using Nearest Neighbour resampling.
image.ResizeWidthProportionally(image.Width / 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
// Save to PNG with the default options.
image.Save(dir + "downsample.nearestneighbour.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Tiff.TiffImage image = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
// Scale up by 2 times using Bilinear resampling.
image.ResizeWidthProportionally(image.Width* 2, Aspose.Imaging.ResizeType.BilinearResample);
// Save to PNG with the default options.
image.Save(dir + "upsample.bilinear.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
using (Aspose.Imaging.FileFormats.Tiff.TiffImage image = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
// Scale down by 2 times using Bilinear resampling.
image.ResizeWidthProportionally(image.Width / 2, Aspose.Imaging.ResizeType.BilinearResample);
// Save to PNG with the default options.
image.Save(dir + "downsample.bilinear.png", new Aspose.Imaging.ImageOptions.PngOptions());
}
Rotate(フラット、ボール、色)
画像を中心点の周りに指定された角度で回転し、正確性を可能にします。オリエンテーション調整:この機能を画像処理に組み込むパイプラインは、正確な変換を促進し、最適な調和を確保し、アプリケーション内のビジュアルコンテンツの紹介
public override void Rotate(float angle, bool resizeProportionally, Color backgroundColor)
Parameters
angle
float
ポジティブな値は時計的に回転します。
resizeProportionally
bool
「真実」に設定された場合、画像のサイズは回転直角(角点)プロジェクションに従って変更され、その他の場合、サイズが触れず、内部画像のみが回転されます。
backgroundColor
Color
背景の色。
Examples
下記の例では、45度の時計幅で中心の周りにTIFF画像を回転する方法を示しています。
string dir = "c:\\temp\\";
Aspose.Imaging.ImageOptions.TiffOptions createTiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Create a permanent, not temporary file source.
createTiffOptions.Source = new Aspose.Imaging.Sources.FileCreateSource(dir + "rotated.tif", false);
createTiffOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
createTiffOptions.BitsPerSample = new ushort[] { 8, 8, 8 };
using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Image.Create(createTiffOptions, 100, 100))
{
// The linear gradient from the left-top to the right-bottom corner of the image.
Aspose.Imaging.Brushes.LinearGradientBrush brush =
new Aspose.Imaging.Brushes.LinearGradientBrush(
new Aspose.Imaging.Point(0, 0),
new Aspose.Imaging.Point(tiffImage.Width, tiffImage.Height),
Aspose.Imaging.Color.Red,
Aspose.Imaging.Color.Green);
// Fill the active frame with the linear gradient brush.
Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(tiffImage);
gr.FillRectangle(brush, tiffImage.Bounds);
// Rotate the image around the center by 45 degrees clockwise.
// The image size changed according to rotated rectangle (corner points).
tiffImage.Rotate(45f, true, Aspose.Imaging.Color.Black);
tiffImage.Save();
// Rotate the image around the center by 45 degrees clockwise.
// Leave the image dimensions untouched and only the internal image content are rotated.
tiffImage.Rotate(45f, false, Aspose.Imaging.Color.Gray);
tiffImage.Save(dir + "rotated.preservesize.tif");
}
RotateFlip(RotateFlipType)
回転、フリッピング、または両方の操作の組み合わせを実行する。この方法は、個々のフレームの正確な操作を可能にします。画像の順序、画像編集および構成における柔軟性の向上あなたの応募
public override void RotateFlip(RotateFlipType rotateFlipType)
Parameters
rotateFlipType
RotateFlipType
ローテットフリップタイプ
Examples
この例では、TIFF画像を積み重ね、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.Tiff.TiffImage image = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
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
ストリームは、オブジェクトのデータを保存します。
SetResolution(ダブル、ダブル)
指定された Aspose.Imaging.RasterImage の解像度を設定し、画像の表示と表示の特性の正確なコントロール。機能性 視覚出力を最適化し、多様性との互換性を確保する出力デバイスとプラットフォーム、全体的なユーザー体験を向上させる。
public override void SetResolution(double dpiX, double dpiY)
Parameters
dpiX
double
Aspose.Imaging.RasterImage の垂直解像度は、インチあたりの点で、
dpiY
double
Aspose.Imaging.RasterImage の垂直解像度は、インチあたりの点で表示されます。
Examples
下記の例では、TIFF画像の水平/垂直解像度を設定する方法を示しています。
string dir = "c:\\temp\\";
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)image;
// Get horizontal and vertical resolution of the TiffImage.
double horizontalResolution = tiffImage.HorizontalResolution;
double verticalResolution = tiffImage.VerticalResolution;
System.Console.WriteLine("The horizontal resolution, in pixels per inch: {0}", horizontalResolution);
System.Console.WriteLine("The vertical resolution, in pixels per inch: {0}", verticalResolution);
if (horizontalResolution != 96.0 || verticalResolution != 96.0)
{
// Use the SetResolution method for updating both resolution values in a single call.
System.Console.WriteLine("Set resolution values to 96 dpi");
tiffImage.SetResolution(96.0, 96.0);
System.Console.WriteLine("The horizontal resolution, in pixels per inch: {0}", tiffImage.HorizontalResolution);
System.Console.WriteLine("The vertical resolution, in pixels per inch: {0}", tiffImage.VerticalResolution);
}
}
UpdateDimensions(int、 int)
画像のサイズを更新します。
protected override void UpdateDimensions(int newWidth, int newHeight)
Parameters
newWidth
int
新しい画像の幅。
newHeight
int
新しい画像の高さ。