SizeCommand Class (original) (raw)

Summary

Resizes an image to a new width and height.

Syntax

C#

Objective-C

C++/CLI

Java

Python

@interface LTSizeCommand : LTRasterCommand 
public class SizeCommand extends RasterCommand 
class SizeCommand(RasterCommand): 

Example

This example will convert an image to a thumbnail size before saving it to disk.

using Leadtools; using Leadtools.Codecs; using Leadtools.ImageProcessing; public void SizeCommandExample() { RasterCodecs codecs = new RasterCodecs(); string srcFileName = Path.Combine(LEAD_VARS.ImagesDir, "Image1.cmp"); string destFileName = Path.Combine(LEAD_VARS.ImagesDir, "SizeCommand.bmp"); // Load the source image from disk RasterImage image = codecs.Load(srcFileName); SizeCommand command = new SizeCommand(); command.Width = 128; command.Height = 128; command.Flags = RasterSizeFlags.Resample; command.Run(image); // Save the image back to disk codecs.Save(image, destFileName, RasterImageFormat.Bmp, 8); // Clean Up image.Dispose(); codecs.Dispose(); } static class LEAD_VARS { public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; }

Leadtools Assembly

Convert(byte[],int,int,int,int,RasterByteOrder,RasterByteOrder,RasterColor[],RasterColor[],int,int,int,RasterConvertBufferFlags) Method

Convert(byte[],int,int,int,int,RasterByteOrder,RasterByteOrder,RasterColor[],RasterColor[],RasterColor16[],RasterColor16[],int,int,int,RasterConvertBufferFlags) Method

Convert(IntPtr,int,int,int,RasterByteOrder,RasterByteOrder,RasterColor[],RasterColor[],int,int,int,RasterConvertBufferFlags) Method

Convert(IntPtr,int,int,int,RasterByteOrder,RasterByteOrder,RasterColor[],RasterColor[],RasterColor16[],RasterColor16[],int,int,int,RasterConvertBufferFlags) Method