Class TiffImage
ชื่อพื้นที่: Aspose.Imaging.FileFormats.Tiff การประกอบ: Aspose.Imaging.dll (25.4.0)
การประมวลผล Tagged Image File Format (TIFF) raster รูปภาพพร้อม 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
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");
}
สร้างทรัพยากร Path โดยใช้กราฟิก Path
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 จาก scratch และบันทึกเป็นไฟล์
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
ตัวอย่างนี้แสดงให้เห็นวิธีการสร้างภาพ TIFF ด้วย 2 แอบและบันทึกไว้ในไฟล์
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
การจัดการโครงสร้างที่ใช้งานได้อย่างราบรื่นช่วยให้การนําทางไดนามิกและการจัดการภายใน kontext ที่กําหนด ช่วยให้แอพพลิเคชันของคุณโต้ตอบมีประสิทธิภาพกับเนื้อหามัลติมัลติมัลติมัลติมัลติมัลติมัลติมัลติมัลติมัลติมัลติมัลติมัลติมัลติมัลติมัลติมัลติ
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
Retrieve ชุดของ 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 และ compositing การบูรณาการฟังก์ชั่นนี้เพื่อเพิ่มประสิทธิภาพกระแสการประมวลผลภาพการทํางานเพื่อให้แน่ใจว่าการแสดงผลและการจัดการที่ถูกต้องขององค์ประกอบโปร่งใส
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 ที่ระบุไว้ในพิกเซลper นิ้วช่วยให้การปรับความแม่นยําและการปรับความสามารถการประมวลผลรูปภาพที่สําคัญโดยไม่มีความพยายามช่วยให้การประมวลผลรูปภาพที่เรียบง่ายกระแสการทํางานสําหรับประสบการณ์ผู้ใช้ที่เพิ่มขึ้น
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
หมายเหตุตาม default หมายเลขนี้เป็น 96 เนื่องจากแพลตฟอร์มที่แตกต่างกันไม่สามารถคืนความละเอียดหน้าจอได้ คุณสามารถพิจารณาการใช้วิธีการ SetResolution เพื่อปรับปรุงค่าความละเอียดทั้งสองในโทรเดียว
PageCount
ปรับปรุงจํานวนหน้าทั้งหมดภายในเอกสารที่ระบุการนําทางและจัดการเนื้อหาหลายหน้าได้อย่างมีประสิทธิภาพ รวมเนื้อหานี้ฟังก์ชั่นเพื่อปรับปรุงประสบการณ์ของผู้ใช้โดยช่วยให้สามารถเข้าถึงได้โดยไม่มีรอยต่อโครงสร้างเอกสารที่ครอบคลุม
public override int PageCount { get; }
คุณสมบัติมูลค่า
Pages
การเข้าถึงหน้าเอกสารได้อย่างราบรื่นเพื่อให้สามารถนําทางแบบไดนามิกและการจัดการภายในโครงสร้างเนื้อหา ช่วยให้แอพพลิเคชันของคุณมีประสิทธิภาพการเข้าถึงหน้าส่วนบุคคลเพื่อให้การประมวลผลเอกสารที่เรียบง่ายและการโต้ตอบของผู้ใช้ที่เพิ่มขึ้น
public override Image[] Pages { get; }
คุณสมบัติมูลค่า
Image [ ]
PremultiplyComponents
แสดงให้เห็นว่าส่วนประกอบต้องการการชั่วคราวเพื่อให้แน่ใจว่าการจัดการที่มีประสิทธิภาพขององค์ประกอบภาพ การปรับปรุงกระบวนการ rendering โดย toggling ของคุณสมบัตินี้กระแสการทํางานกราฟิกที่เรียบง่ายสําหรับประสิทธิภาพที่เพิ่มประสิทธิภาพ
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 ที่กําหนดไว้ใน pixels perนิ้วช่วยให้การปรับความแม่นยําและการเพิ่มประสิทธิภาพการทํางาน ใช้สิ่งสําคัญการประมวลผลข้อมูลภาพได้อย่างง่ายดายเพื่อให้การประมวลผลการทํางานของภาพได้อย่างราบรื่นเพื่อให้แน่ใจว่าคุณภาพและประสิทธิภาพที่เหนือกว่าในการใช้งานของคุณ
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
หมายเหตุตาม default หมายเลขนี้เป็น 96 เนื่องจากแพลตฟอร์มที่แตกต่างกันไม่สามารถคืนความละเอียดหน้าจอได้ คุณสามารถพิจารณาการใช้วิธีการ SetResolution เพื่อปรับปรุงค่าความละเอียดทั้งสองในโทรเดียว
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[])
integram the array of frames seamlessly into the image, enriching its content และความหลากหลาย ใช้วิธีการนี้เพื่อปรับปรุงการประกอบภาพและการจัดการช่วยให้การจัดการที่มีประสิทธิภาพของภาพหลายเฟรมภายในแอพของคุณ
public void AddFrames(TiffFrame[] frames)
Parameters
frames
TiffFrame
[ ]
รั้ว Array เพื่อเพิ่ม
AddPage(RasterImage)
รวมหน้าใหม่ลงในภาพที่มีอยู่โดยไม่มีรอยต่อการขยายเนื้อหาของมันและความหลากหลาย ใช้วิธีการนี้เพื่อปรับปรุงองค์ประกอบเอกสารและการจัดการช่วยให้การจัดการที่มีประสิทธิภาพของภาพหลายหน้าภายในแอพของคุณ
public virtual void AddPage(RasterImage page)
Parameters
page
RasterImage
หน้าที่เพิ่ม
Exceptions
page’ is null.
AdjustBrightness(int)
การปรับความสว่าง สําหรับภาพช่วยให้การเปลี่ยนแปลงของระดับความสว่างโดยรวม รวมวิธีการนี้เข้าสู่การประมวลผลภาพของคุณเพื่อเพิ่มความเห็นและปรับปรุงคุณภาพภาพภายในแอพของคุณ
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(เฟอร์รี่, เฟอร์รี่, เฟอร์รี่)
ทําการแก้ไขเกัมม้าบนภาพโดยใช้ koeficients ส่วนบุคคลสําหรับสีแดงช่องสีเขียวและสีน้ําเงินซึ่งช่วยให้การปรับความสมดุลสีได้ดีและ contrast. รวมวิธีการนี้ในท่อประมวลผลภาพของคุณเพื่อให้การควบคุมที่แม่นยําของการแสดงสีและเพิ่มความซื่อสัตย์ภาพภายในการสมัครของคุณ
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 Helper Method สําหรับการซิงค์แนวนอนและโซลูชันแนวตั้งเพื่อให้แน่ใจว่าความสม่ําเสมอในขนาดภาพ ฟังก์ชั่นนี้ง่ายต่อการประมวลผลภาพอัตราการทํางานโดยการปรับความละเอียดพารามิเตอร์ที่เพิ่มประสิทธิภาพคุณภาพภาพและความสม่ําเสมอบนแพลตฟอร์มต่างๆและอุปกรณ์
public void AlignResolutions()
BinarizeBradley(สอง, int)
การนําไปใช้การไบนาริชั่นบนภาพที่ใช้ขอบเขตการปรับแต่งของ Bradleyalgorithm with integral image thresholding วิธีการนี้จะคํานวณแบบไดนามิกขอบเขตท้องถิ่นขึ้นอยู่กับสภาพแวดล้อมของภาพเพิ่มความสามารถในการปรับแต่งเงื่อนไขการสว่างที่แตกต่างกันและให้แน่ใจว่าการแยกที่แข็งแกร่งสําหรับภายหลังการประมวลผลงานภายในใบสมัครของคุณ
public override void BinarizeBradley(double brightnessDifference, int windowSize)
Parameters
brightnessDifference
double
ความแตกต่างของความสว่างระหว่างพิกเซลและเฉลี่ยของหน้าต่าง s x s ของพิกเซลมุ่งเน้นรอบพิกเซลนี้
windowSize
int
ขนาดหน้าต่าง s x s ของพิกเซลที่มุ่งเน้นรอบพิกเซลนี้
Examples
ตัวอย่างต่อไปนี้ไบนารีภาพ TIFF กับแอลกอริทึมการปรับแต่งของ Bradley กับขนาดหน้าต่างที่ระบุ ภาพไบนารีมีเพียง 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 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 เพื่อดําเนินการไบนารีภาพโดยอัตโนมัติการกําหนดค่าข้อ จํากัด ที่เหมาะสมขึ้นอยู่กับ histogram ของภาพวิธีการนี้เข้าสู่การประมวลผลภาพของคุณกระแสการทํางานเพื่อให้บรรลุการแบ่งอย่างมีประสิทธิภาพและลักษณะการสกัดเพิ่มความแม่นยําและความน่าเชื่อถือของการวิเคราะห์ภาพงานภายในใบสมัครของคุณ
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)
ทําการรวบรวมบนภาพโดยระบุการเปลี่ยนแปลงในด้านซ้ายด้านซ้ายด้านบนและแนวทางด้านล่าง วิธีนี้ช่วยให้การเลือกที่แม่นยําของส่วนที่ต้องการของภาพที่ช่วยให้การกําจัดพื้นที่ที่ไม่ต้องการได้อย่างมีประสิทธิภาพและมุ่งเน้นไปที่เนื้อหาที่สําคัญ รวมฟังก์ชั่นนี้เข้าสู่การประมวลผลภาพของคุณท่อเพื่อเพิ่มความชัดเจนและองค์ประกอบตามที่จําเป็นภายในแอพลิเคชันของคุณ
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, IColorPalette)
การดําเนินการไทเทเนียมบนภาพปัจจุบันเพื่อปรับปรุงคุณภาพภาพและลดสี banding artifacts รวมวิธีการนี้เข้าสู่การประมวลผลภาพของคุณเพื่อให้แน่ใจว่าการเปลี่ยนแปลงระหว่างสีมีความราบรื่นมากขึ้นซึ่งนําไปสู่ภาพรวมที่ดีขึ้นความปรากฏและความชัดเจน
public override void Dither(DitheringMethod ditheringMethod, int bitsCount, IColorPalette customPalette)
Parameters
ditheringMethod
DitheringMethod
วิธีการไดร์เวอร์
bitsCount
int
บิตสุดท้ายคํานวณสําหรับ dithering
customPalette
IColorPalette
แพลิเคชันที่กําหนดเองสําหรับ dithering
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, FilterOptionsBase)
กรองเนื้อหาภายในมุมตรงที่กําหนดโดยใช้ภาพที่กําหนดกรองการประมวลผลเพื่อปรับปรุงหรือปรับเปลี่ยนภูมิภาคที่เลือก รวมวิธีการนี้เข้าสู่การทํางานการจัดการภาพของคุณเพื่อบรรลุการปรับปรุงเป้าหมายหรือการเปลี่ยนแปลงภายในแอพพลิเคชันของคุณ
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()
Retrieve options derived from the original file settings, ช่วยให้ได้ง่ายการรักษาพารามิเตอร์สําคัญเช่นความลึกของ bit และคุณสมบัติสําคัญอื่น ๆ ของภาพต้นฉบับ ใช้วิธีการนี้เพื่อรักษาความซื่อสัตย์และความสอดคล้องงานการประมวลผลภาพเพื่อให้แน่ใจว่าผลลัพธ์ที่ดีที่สุดโดยไม่มีการเปลี่ยนแปลงที่ไม่จําเป็นตัวอย่างเช่นถ้าเราโหลดภาพ PNG สีดําและสีขาวด้วย 1 บิตต่อพิกเซลแล้วบันทึกมันโดยใช้Aspose.Imaging.DataStreamSupporter.Save(System.String) วิธีการภาพ PNG output กับ 8 บิตต่อพิกเซลจะผลิตเพื่อหลีกเลี่ยงและบันทึกภาพ PNG ด้วย 1 บิตต่อพิกเซลใช้วิธีการนี้เพื่อรับตัวเลือกการบันทึกที่เหมาะสมและผ่านพวกเขาวิธีการ Aspose.Imaging.Image.Save(System.String,Aspose.Imaging.ImageOptionsBase) เป็นพารามิเตอร์ที่สอง
public override ImageOptionsBase GetOriginalOptions()
Returns
ตัวเลือกตามการตั้งค่าไฟล์เดิม
Exceptions
ไม่มีตัวเลือกเดิมที่สามารถสกัดจากภาพ
Grayscale()
แปลงภาพไปสู่การแสดงผลสีเทาของมัน แปลงมันไปสู่การแสดงผลรูปแบบช่องเดียวที่แต่ละพิกเซลแสดงความเข้ม รวมวิธีการนี้ในท่อการประมวลผลภาพของคุณเพื่อให้การวิเคราะห์ที่เรียบง่ายและปรับปรุงความเข้ากันได้กับแอลกอริทึมบนพื้นฐานของ grayscale ช่วยให้เครื่องคอมพิวเตอร์ต่าง ๆงานวิเคราะห์ภาพและภาพภายในแอพพลิเคชันของคุณ
public override void Grayscale()
Examples
ตัวอย่างต่อไปนี้จะแปลงภาพ TIFF สีเป็นภาพสีเทา รูปภาพ Grayscale ประกอบด้วยภาพสีเทาและมีข้อมูลความเข้มเท่านั้น
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(int, TiffFrame)
ใส่กรอบใหม่ในดัชนีที่ระบุภายในชุดกรอบเพื่อให้แน่ใจว่าการควบคุมที่แม่นยําเกี่ยวกับการจัดระเบียบเฟรม ใช้วิธีการนี้เพื่อจัดการเฟรมการติดตามได้อย่างมีประสิทธิภาพช่วยให้การจัดการแบบไดนามิกและการจัดระเบียบของภาพเนื้อหาภายในแอพลิเคชันของคุณ
public void InsertFrame(int index, TiffFrame frameToInsert)
Parameters
index
int
หมายเลขเฟรมใหม่ในรายการเฟรม
frameToInsert
TiffFrame
กรอบที่จะใส่
NormalizeAngle(บอล, สี)
ใช้วิธีการ NormalizeAngle ออกแบบโดยเฉพาะสําหรับเอกสารข้อความที่สแกนเพื่อแก้ไขการสแกนสกปรกเพื่อให้แน่ใจว่าการสอดคล้องที่แม่นยําintegre this functionality into your text processing workflows เพื่อปรับปรุงความสามารถในการอ่านและคุณภาพของเอกสารเพื่อปรับปรุงประสิทธิภาพโดยรวมในการรับรู้ข้อความและงานวิเคราะห์วิธีการนี้ใช้วิธีการ 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
ถ้าคุณตั้งค่าเป็น “จริง” คุณจะมีการเปลี่ยนแปลงขนาดภาพของคุณตามแนวตั้งหมุน (จุดมุม) projections ในกรณีอื่น ๆ ที่ปล่อยให้ขนาดไม่สัมผัสและเนื้อหาภาพภายในเท่านั้นจะหมุน
backgroundColor
Color
สีของพื้นหลัง
ReleaseManagedResources()
เปิดตัวทรัพยากรที่จัดการ ตรวจสอบให้แน่ใจว่าไม่มีทรัพยากรที่ไม่ได้จัดการจะเปิดตัวที่นี่เนื่องจากอาจมีการเปิดตัวแล้ว
protected override void ReleaseManagedResources()
RemoveFrame(int)
ลบอย่างหนักกรอบที่ระบุโดย index จาก sequence ของภาพการจัดการโครงสร้างที่เรียบง่ายภายในแอพพลิเคชันของคุณ การบูรณาการนี้ความสามารถในการทํางานเพื่อเพิ่มประสิทธิภาพและความแม่นยําในการจัดการเฟรมช่วยให้การจัดเรียงและการนําเสนอเนื้อหาภาพได้ง่าย
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)
การกําจัดกรอบที่ระบุได้อย่างมีประสิทธิภาพจาก sequence ของภาพโดยช่วยให้การจัดการโครงสร้างที่เรียบง่ายภายในแอพพลิเคชันของคุณ การรวมฟังก์ชั่นนี้เพื่อเพิ่มความแม่นยําและความยืดหยุ่นในการจัดการเฟรมเพื่อให้แน่ใจว่าไม่มีรอยต่อการจัดเตรียมและนําเสนอเนื้อหาภาพ
public void RemoveFrame(TiffFrame frame)
Parameters
frame
TiffFrame
กรอบที่จะลบ
Remarks
หมายเหตุ: อย่าลืมวางกรอบถ้าคุณจะไม่เพิ่มมันไปยัง TiffImage อื่น ๆ
RemoveMetadata()
ลบตัวอย่างภาพนี้ metadata โดยการตั้งค่านี้ Aspose.Imaging.Xmp.IHasXMPData.xmpdata และ _ www.exif.ihas ExifDate. 0 0 0.
public override void RemoveMetadata()
ReplaceFrame(int, TiffFrame)
เปลี่ยนกรอบในตําแหน่งที่กําหนดด้วยกรอบอื่นโดยไม่มีรอยต่อช่วยให้การจัดการโครงสร้างแบบไดนามิกภายใน sequence ภาพรวมนี้วิธีการเพิ่มความยืดหยุ่นและความแม่นยําในการจัดการเฟรมเพื่อให้แน่ใจว่าการจัดระเบียบที่ดีที่สุดและการนําเสนอเนื้อหาภาพภายในแอพลิเคชันของคุณ
public TiffFrame ReplaceFrame(int index, TiffFrame frameToReplace)
Parameters
index
int
โพสต์เฟรมแบบ Zero Based
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(int, ResizeType)
ทําการปรับระดับความสูงของภาพโดยการรักษาลักษณะของภาพratio for consistent visual integrity ใช้วิธีการนี้เพื่อรีไซเคิลแบบไดนามิกภาพภายในแอพของคุณเพื่อให้การแสดงผลที่ดีที่สุดบนแพลตฟอร์มที่แตกต่างกันและอุปกรณ์โดยไม่มีความเสียหายต่อคุณภาพเนื้อหา
public override void ResizeHeightProportionally(int newHeight, ResizeType resizeType)
Parameters
newHeight
int
ความสูงใหม่
resizeType
ResizeType
ประเภทของ Resize
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)
ใช้วิธีการนี้เพื่อสแกนภาพแบบไดนามิกภายในแอพพลิเคชันของคุณเพื่อให้แน่ใจว่าการแสดงภาพที่สมบูรณ์แบบของเนื้อหา การสแกนแบบ proportional จะสแกนแต่ละกรอบตามความสัมพันธ์ของ newWidth’/width และ
newHeight’/height
public void ResizeProportional(int newWidth, int newHeight, ResizeType resizeType)
Parameters
newWidth
int
ความกว้างใหม่
newHeight
int
ความสูงใหม่
resizeType
ResizeType
ประเภทการรีไซเคิล
ResizeWidthProportionally(int, ResizeType)
การปรับความกว้างของภาพในขณะที่รักษาความสัมพันธ์ด้านของภาพให้แน่ใจว่าการรีไซเคิล proportional สําหรับการแสดงภาพที่ดีที่สุด ใช้วิธีการนี้เพื่อการสแกนภาพแบบไดนามิกภายในแอพพลิเคชันของคุณช่วยให้ภาพมีเสถียรภาพและสวยงามที่สนุกสนาน rendering ทั่ว contexts แสดงที่แตกต่างกัน
public override void ResizeWidthProportionally(int newWidth, ResizeType resizeType)
Parameters
newWidth
int
ความกว้างใหม่
resizeType
ResizeType
ประเภทของ Resize
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
ถ้าคุณตั้งค่าเป็น “จริง” คุณจะมีการเปลี่ยนแปลงขนาดภาพของคุณตามแนวตั้งหมุน (จุดมุม) projections ในกรณีอื่น ๆ ที่ปล่อยให้ขนาดไม่สัมผัสและเนื้อหาภาพภายในเท่านั้นจะหมุน
backgroundColor
Color
สีของพื้นหลัง
Examples
ตัวอย่างต่อไปนี้แสดงให้เห็นว่าวิธีการหมุนภาพ TIFF รอบศูนย์ด้วยมุมเวลา 45 องศา
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
ประเภทหมุน flip
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
ความสูงของภาพใหม่