public RasterColor FillColor { get; set; } @property (nonatomic, copy) LTRasterColor *fillColor; public RasterColor getFillColor();public void setFillColor(RasterColor rasterColor);
public:property RasterColor FillColor {RasterColor get();void set ( RasterColor );}
FillColor # get and set (HighQualityRotateCommand)
A RasterColor object that specifies the background fill color.
The FillColor property will only be used if HighQualityRotateCommandFlags.Resize is specified in the Flags property. Since a RasterImage is always a rectangular object, rotation will always increase the width and height of the image. The extra space will be filled with the color specified in FillColor.
using Leadtools;using Leadtools.Codecs;using Leadtools.ImageProcessing;using Leadtools.ImageProcessing.Core;public void HighQualityRotateCommandExample(){RasterCodecs codecs = new RasterCodecs();// Get an imagestring tifFileName = Path.Combine(LEAD_VARS.ImagesDir, "ocr1.tif");string normalRotateFileName = Path.Combine(LEAD_VARS.ImagesDir, "ocr1_NormalRotated.tif");string highQualityRotateFileName = Path.Combine(LEAD_VARS.ImagesDir, "ocr1_HighQualityRotated.tif");int angle = 30 * 100;RasterColor fillColor = RasterColor.FromKnownColor(RasterKnownColor.White);// Load the image, rotate normally by 30 degrees and saveusing (RasterImage image = codecs.Load(tifFileName)){RotateCommand cmd = new RotateCommand();cmd.Angle = angle;cmd.Flags = RotateCommandFlags.Resize | RotateCommandFlags.Bicubic;cmd.FillColor = fillColor;cmd.Run(image);codecs.Save(image, normalRotateFileName, image.OriginalFormat, image.BitsPerPixel);}// Load the image, rotate with high quality by 30 degrees and saveusing (RasterImage image = codecs.Load(tifFileName)){HighQualityRotateCommand cmd = new HighQualityRotateCommand();cmd.Angle = angle;cmd.Flags = HighQualityRotateCommandFlags.Resize | HighQualityRotateCommandFlags.BestQuality;cmd.FillColor = fillColor;cmd.Run(image);codecs.Save(image, highQualityRotateFileName, image.OriginalFormat, image.BitsPerPixel);}// Now compare the saved TIF files and notice the difference in quality between// the normal rotate and high qualitycodecs.Dispose();}static class LEAD_VARS{public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images";}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
