public RasterImage CreateThumbnail(
int thumbnailWidth,
int thumbnailHeight,
int bitsPerPixel,
RasterViewPerspective viewPerspective,
RasterSizeFlags sizeFlags
)
- (nullable LTRasterImage *)createThumbnailWithWidth:(NSInteger)width
thumbnailHeight:(NSInteger)height
bitsPerPixel:(NSInteger)bitsPerPixel
viewPerspectiveToUse:(LTRasterViewPerspective)viewPerspective
sizeFlags:(LTRasterSizeFlags)sizeFlags
error:(NSError ** )error
public RasterImage createThumbnail(
int thumbnailWidth,
int thumbnailHeight,
int bitsPerPixel,
RasterViewPerspective viewPerspective,
int sizeFlags
);
public:
RasterImage^ CreateThumbnail(
int thumbnailWidth,
int thumbnailHeight,
int bitsPerPixel,
RasterViewPerspective viewPerspective,
RasterSizeFlags sizeFlags
)
def CreateThumbnail(self,thumbnailWidth,thumbnailHeight,bitsPerPixel,viewPerspective,sizeFlags):
thumbnailWidth
The desired maximum width of the thumbnail image in pixels.
thumbnailHeight
The desired maximum height of the thumbnail image in pixels.
bitsPerPixel
The desired bits per pixel.
viewPerspective
The desired view perspective.
sizeFlags
Flags that control the resize operation.
A new RasterImage that is the thumbnail image.
If the image width and height is less than thumbnailWidth and thumbnailHeight, then this method returns a copy of the image in the original size.
If the image width or height is greater than thumbnailWidth and thumbnailHeight, then this method will return the biggest thumbnail it can fit into the dimensions specified by thumbailWidth and thumbnailHeight, keeping the original image aspect ratio.
The result image will always have a resolution of 96 by 96 regardless of the resolution this RasterImage and will never return a thumbnail bigger than the original image.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Core;
using Leadtools.ImageProcessing.Color;
using Leadtools.Dicom;
using Leadtools.Drawing;
using Leadtools.Controls;
using Leadtools.Svg;
public void CreateThumbnailExample()
{
RasterCodecs codecs = new RasterCodecs();
string srcFileName = Path.Combine(LEAD_VARS.ImagesDir, "image1.cmp");
// Load the image
RasterImage srcImage = codecs.Load(srcFileName);
// Use the CreateTumbnail method to create a thumbnail of this image
RasterImage thumbnail = srcImage.CreateThumbnail(200, 200, 24, RasterViewPerspective.TopLeft, RasterSizeFlags.Bicubic);
Assert.IsTrue(thumbnail.PageCount == 1);
// Clean up
thumbnail.Dispose();
srcImage.Dispose();
codecs.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