←Select platform

ShadowCommand Constructor(ShadowCommandAngle,int,ShadowCommandType)

Summary
Initializes a new ShadowCommand class object with explicit parameters.
Syntax
C#
C++/CLI
Python
public: 
ShadowCommand(  
   ShadowCommandAngle angle, 
   int threshold, 
   ShadowCommandType type 
) 
__init__(self,angle,threshold,type) # Overloaded constructor 

Parameters

angle
Angle value indicating the direction of the light source producing the shadow.

threshold
Threshold value used to determine which pixels will be affected . Valid values range from 0 through 255. When Type = ShadowCommandType.ColoredShadow, any component (R, G, or B) of a pixel with a value less than the Threshold value is not affected. When Type = ShadowCommandType.GrayShadow, any pixel where the master channel value is less than the Threshold value is not affected.

type
Type of the shadow.

Example

Run the ShadowCommand on an image.

C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.SpecialEffects; 
 
 
public void ShadowConstructorExample() 
{ 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Master.jpg")); 
 
   // Prepare the command 
   ShadowCommand command = new ShadowCommand(ShadowCommandAngle.SouthEast, 0, ShadowCommandType.GrayShadow); 
   // Apply  shadow effect to the image. 
   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:\LEADTOOLS23\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 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.