←Select platform

FragmentCommand Class

Summary
Averages an image with its shifted copies. This method is available in the Imaging and above toolkits. This method creates four copies of an image. Each copy is shifted by the offset amount into one of the four directions: top, left, bottom and right. Then the image is averaged with its shifted copies.
Syntax
C#
C++/CLI
Python
public class FragmentCommand : RasterCommand 
public ref class FragmentCommand : public RasterCommand   
class FragmentCommand(RasterCommand): 
Remarks
  • This method can process the whole image or a region of the image. If the image has a region, the effect is applied only to the region.
  • This method supports 12-bit and 16-bit grayscale and 48-bit and 64-bit color images. Support for 12-bit and 16-bit grayscale and 48-bit and 64-bit color images is available only in the Document/Medical toolkits.
  • This method does not support signed data images.
  • This command does not support 32-bit grayscale images.

Fragment Function - Before

Fragment Function - Before

Fragment Function - After

Fragment Function - After

View additional platform support for this Fragment function.

Example

Run the FragmentCommand on an image.

C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.SpecialEffects; 
 
 
public void FragmentCommandExample() 
{ 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, @"ImageProcessingDemo\NaturalFruits.jpg")); 
 
   // Prepare the command 
   FragmentCommand command = new FragmentCommand(); 
   command.Offset = 4; 
   command.Opacity = 75; 
   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.