Splits the image into square or rectangular blocks. If the blocks are square, the command rotates each block by 0, 90, 180, or 270 degrees. If the blocks are rectangular, the command flips the blocks around the X-axis or Y-axis. This command is available in the Imaging Pro and above toolkits.
public class DiceEffectCommand : RasterCommand Public Class DiceEffectCommandInherits Leadtools.Imageprocessing.Leadtools.ImageProcessing.RasterCommandImplements Leadtools.Imageprocessing.Leadtools.ImageProcessing.IRasterCommand
public sealed class DiceEffectCommand : Leadtools.Imageprocessing.Leadtools.ImageProcessing.IRasterCommand function Leadtools.ImageProcessing.SpecialEffects.DiceEffectCommand() public ref class DiceEffectCommand : public Leadtools.Imageprocessing.Leadtools.ImageProcessing.RasterCommand, Leadtools.Imageprocessing.Leadtools.ImageProcessing.IRasterCommand For more information, refer to Applying Artistic Effects.
Run the DiceEffectCommand on an image.
using Leadtools;using Leadtools.Codecs;using Leadtools.ImageProcessing.SpecialEffects;public void DiceEffectCommandExample(){// Load an imageRasterCodecs codecs = new RasterCodecs();codecs.ThrowExceptionsOnInvalidImages = true;RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, @"ImageProcessingDemo\Image2.jpg"));// Prepare the commandDiceEffectCommand command = new DiceEffectCommand();command.XBlock = 16;command.YBlock = 16;command.Randomize = 0;command.Flags = DiceEffectCommandFlags.Count |DiceEffectCommandFlags.Border;command.BorderColor = new RasterColor(0, 0, 0);// Apply Dice Effect for this 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:\Users\Public\Documents\LEADTOOLS Images";}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.ImageProcessing.SpecialEffectsLeadtools.Examples.Support.SetLicense()Public Sub DiceEffectCommandExample()Dim codecs As New RasterCodecs()codecs.ThrowExceptionsOnInvalidImages = TrueDim leadImage As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "ImageProcessingDemo\\Image2.jpg"))' Prepare the commandDim command As DiceEffectCommand = New DiceEffectCommandcommand.XBlock = 16command.YBlock = 16command.Randomize = 0command.Flags = DiceEffectCommandFlags.Count Or DiceEffectCommandFlags.Bordercommand.BorderColor = New RasterColor(0, 0, 0)' Apply Dice Effect for this image.command.Run(leadImage)codecs.Save(leadImage, Path.Combine(LEAD_VARS.ImagesDir, "Result.jpg"), RasterImageFormat.Jpeg, 24)End SubPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"End Class
Leadtools.ImageProcessing.SpecialEffects Namespace
Leadtools.ImageProcessing.Effects.DisplacementCommand
Leadtools.ImageProcessing.Core.HalfTonePatternCommand
Leadtools.ImageProcessing.Effects.MaskConvolutionCommand
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
