←Select platform

ResizeInterpolateCommand Constructor(int,int,ResizeInterpolateCommandType)

Summary
Initializes a new instance of ResizeInterpolateCommand class with explicit parameters.
Syntax
C#
Objective-C
C++/CLI
Java
Python
- (instancetype)initWithWidth:(NSInteger)width height:(NSInteger)height type:(LTResizeInterpolateCommandType)resizeType NS_DESIGNATED_INITIALIZER; 
public ResizeInterpolateCommand( 
   int width, 
   int height, 
   ResizeInterpolateCommandType resizeType 
); 
public: 
ResizeInterpolateCommand(  
   int width, 
   int height, 
   ResizeInterpolateCommandType resizeType 
) 
__init__(self,width,height,resizeType) # Overloaded constructor 

Parameters

width
Value that represents the desired image's width in pixels.

height
Value that represents the desired image's height in pixels.

resizeType
Value that represents the algorithm type used in resizing the image. For possible values refer to ResizeInterpolateCommandType.

Example

Run the ResizeCommand on an image.

C#
Java
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.Core; 
 
 
public void ResizeConstructorExample() 
{ 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "sample5.cmp")); 
 
   // Prepare the command 
   // Resize the bitmap into 50 pixels x 50 pixels using the Bilinear algorithm. 
   ResizeInterpolateCommand command = new ResizeInterpolateCommand(50, 50, ResizeInterpolateCommandType.Bilinear); 
   command.Run(image); 
 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
 
import java.io.File; 
import java.io.IOException; 
 
import org.junit.*; 
import org.junit.runner.JUnitCore; 
import org.junit.runner.Result; 
import org.junit.runner.notification.Failure; 
import static org.junit.Assert.*; 
 
import leadtools.*; 
import leadtools.codecs.*; 
import leadtools.imageprocessing.core.*; 
 
 
public void resizeConstructorExample() { 
    final String LEAD_VARS_IMAGES_DIR = "C:\\LEADTOOLS23\\Resources\\Images"; 
 
    // Load an image 
    RasterCodecs codecs = new RasterCodecs(); 
    codecs.setThrowExceptionsOnInvalidImages(true); 
 
    RasterImage image = codecs.load(combine(LEAD_VARS_IMAGES_DIR, "sample5.cmp")); 
 
    // Prepare the command 
    // Resize the bitmap into 50 pixels x 50 pixels using the Bilinear algorithm. 
    ResizeInterpolateCommand command = new ResizeInterpolateCommand(50, 50, ResizeInterpolateCommandType.BILINEAR); 
    int change = command.run(image); 
    assertTrue(change != RasterImageChangedFlags.NONE); 
 
    codecs.save(image, combine(LEAD_VARS_IMAGES_DIR, "Result.jpg"), RasterImageFormat.JPEG, 24); 
    System.out.println("Command run and image saved to " + combine(LEAD_VARS_IMAGES_DIR, "Result.jpg")); 
} 
Requirements

Target Platforms

Help Version 23.0.2024.3.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.ImageProcessing.Core Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.