ResizeCommand Class (original) (raw)

Summary

Resizes the image from an existing image, and puts the resized image into a destination image, leaving the original image intact.

Syntax

C#

Objective-C

C++/CLI

Java

Python

@interface LTResizeCommand : LTRasterCommand 
public class ResizeCommand extends RasterCommand 
class ResizeCommand(RasterCommand): 

Example

This example will load an image and then resize it into an existing, smaller image.

using Leadtools; using Leadtools.Codecs; using Leadtools.ImageProcessing; public void ResizeCommandExample() { RasterCodecs codecs = new RasterCodecs(); string srcFileName = Path.Combine(LEAD_VARS.ImagesDir, "Image1.cmp"); string destFileName = Path.Combine(LEAD_VARS.ImagesDir, "ResizeCommand.bmp"); // Load the source image from disk RasterImage srcImage = codecs.Load(srcFileName); // Create the destination image RasterImage destImage = new RasterImage( RasterMemoryFlags.Conventional, 100, 100, srcImage.BitsPerPixel, srcImage.Order, srcImage.ViewPerspective, srcImage.GetPalette(), IntPtr.Zero, 0); // Resize the source image into the destination image ResizeCommand command = new ResizeCommand(); command.DestinationImage = destImage; command.Flags = RasterSizeFlags.Bicubic; command.Run(srcImage); // Save it to disk codecs.Save(destImage, destFileName, RasterImageFormat.Bmp, 24); // Clean Up srcImage.Dispose(); destImage.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