←Select platform

Height Property

Summary
Gets or sets the desired height for the image.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public int Height { get; set; } 
@property (nonatomic, assign) NSInteger height; 
public int getHeight(); 
public void setHeight( 
   int intValue 
); 
public: 
property int Height { 
   int get(); 
   void set (    int ); 
} 
Height # get and set (ResizeInterpolateCommand) 

Property Value

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

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.