←Select platform

GlassEffectCommand Constructor(int,int,GlassEffectCommandFlags)

Summary
Initializes a new GlassEffectCommand class object with explicit parameters.
Syntax
C#
C++/CLI
Python
public: 
GlassEffectCommand(  
   int cellWidth, 
   int cellHeight, 
   GlassEffectCommandFlags flags 
) 
__init__(self,cellWidth,cellHeight,flags) # Overloaded constructor 

Parameters

cellWidth
Value that represents the width of a cell in pixels or the number of cells present across the width of the image, based on the flags that are set. The valid range is between 2 and half the image width.

cellHeight
Value that represents the height of a cell in pixels or the number of cells present across the height of the image, based on the flags that are set. The valid range is between 2 and half the image height.

flags
Flags that indicate what type of data is in the cellWidth and cellHeight parameters.

Example

Run the GlassEffectCommand on an image.

C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.SpecialEffects; 
 
 
public void GlassEffectConstructorExample() 
{ 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, @"ImageProcessingDemo\Image1.jpg")); 
 
   // Prepare the command 
   GlassEffectCommand command = new GlassEffectCommand(20, 20, GlassEffectCommandFlags.WidthFrequency | GlassEffectCommandFlags.HeightPeriod); 
   // Apply glass effect. 
   command.Run(image); 
   codecs.Save(image, Path.Combine(LEAD_VARS.ImagesDir, "Result.jpg"), RasterImageFormat.Jpeg, 24); 
 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

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

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