←Select platform

ResizeType Property

Summary
Gets or sets the resize algorithm type.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public ResizeInterpolateCommandType ResizeType { get; set; } 
@property (nonatomic, assign) LTResizeInterpolateCommandType resizeType; 
public ResizeInterpolateCommandType getResizeType(); 
public void setResizeType( 
   ResizeInterpolateCommandType resizeInterpolateCommandType 
); 
public: 
property ResizeInterpolateCommandType ResizeType { 
   ResizeInterpolateCommandType get(); 
   void set (    ResizeInterpolateCommandType ); 
} 
ResizeType # get and set (ResizeInterpolateCommand) 

Property Value

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

Example
C#
Java
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.Core; 
 
 
public void ResizeCommandExample() 
{ 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "sample5.cmp")); 
 
   // Prepare the command 
   ResizeInterpolateCommand command = new ResizeInterpolateCommand(); 
 
   // Resize the bitmap into 50 pixels x 50 pixels using the Bilinear algorithm. 
   command.Width = 50; 
   command.Height = 50; 
   command.ResizeType = 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 resizeCommandExample() { 
    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 
    ResizeInterpolateCommand command = new ResizeInterpolateCommand(); 
 
    // Resize the bitmap into 50 pixels x 50 pixels using the Bilinear algorithm. 
    command.setWidth(50); 
    command.setHeight(50); 
    command.setResizeType(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.