LEADTOOLS Image Processing (Leadtools.ImageProcessing.Core assembly)
LEAD Technologies, Inc

HalfTonePatternCommand Class

Example 





Members 
Creates a halftone screen effect for an image while keeping its continuous range of tones. This method is available in the Document/Medical toolkits. .NET support WinRT support
Object Model
HalfTonePatternCommand Class
Syntax
'Declaration
 
Public Class HalfTonePatternCommand 
   Inherits Leadtools.ImageProcessing.RasterCommand
   Implements Leadtools.ImageProcessing.IRasterCommand 
'Usage
 
Dim instance As HalfTonePatternCommand
public sealed class HalfTonePatternCommand : Leadtools.ImageProcessing.IRasterCommand  
function Leadtools.ImageProcessing.Core.HalfTonePatternCommand()
public ref class HalfTonePatternCommand : public Leadtools.ImageProcessing.RasterCommand, Leadtools.ImageProcessing.IRasterCommand  
Remarks
Example
 
Public Sub HalfTonePatternCommandExample()
   Dim codecs As New RasterCodecs()
   codecs.ThrowExceptionsOnInvalidImages = True

   Dim leadImage As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Master.jpg"))

   ' Prepare the command
   Dim command As New HalfTonePatternCommand
   command.Contrast = 100
   command.Ripple = 200
   command.AngleContrast = 12
   command.AngleRipple = 2
   command.AngleOffset = 4500
   command.BackGroundColor = New RasterColor(255, 255, 255)
   command.ForeGroundColor = New RasterColor(255, 0, 0)
   command.Type = HalfTonePatternCommandType.Line
   command.Run(leadImage)

End Sub

Public NotInheritable Class LEAD_VARS
   Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class
public void HalfTonePatternCommandExample()
   {
      // Load an image
      RasterCodecs codecs = new RasterCodecs();
      codecs.ThrowExceptionsOnInvalidImages = true;

      RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Master.jpg"));

      // Prepare the command
      HalfTonePatternCommand command  = new HalfTonePatternCommand();
      command.Contrast = 100;
      command.Ripple = 200;
      command.AngleContrast = 12;
      command.AngleRipple = 2;
      command.AngleOffset = 4500;
      command.BackGroundColor = new RasterColor(255, 255, 255);
      command.ForeGroundColor = new RasterColor(255, 0,0);
      command.Type = HalfTonePatternCommandType.Line;
      command.Run(image);

   }

static class LEAD_VARS
{
   public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
}
function HalfTonePatternCommandExample()
{
   var codecs = new Leadtools.Codecs.RasterCodecs();
   codecs.throwExceptionsOnInvalidImages = true;

   // Load the image
   var srcFileName = "Assets\\Image1.cmp";
   return Tools.AppInstallFolder().getFileAsync(srcFileName).then(function (loadFile) {
      return codecs.loadAsync(Leadtools.LeadStreamFactory.create(loadFile));
   }).then(function (image) {
      // Prepare the command
      with (Leadtools.ImageProcessing.Core) {
         var command  = new HalfTonePatternCommand();
         command.contrast = 100;
         command.ripple = 200;
         command.angleContrast = 12;
         command.angleRipple = 2;
         command.angleOffset = 4500;
         command.backGroundColor = Leadtools.RasterColorHelper.create(255, 255, 255);
         command.foreGroundColor = Leadtools.RasterColorHelper.create(255, 0,0);
         command.type = HalfTonePatternCommandType.line;
         command.run(image);
      }
   });
}
[TestMethod]
public async Task HalfTonePatternCommandExample()
{
   // Load an image
   RasterCodecs codecs = new RasterCodecs();
   codecs.ThrowExceptionsOnInvalidImages = true;
   // Load the image
   string srcFileName = @"Assets\Image1.cmp";
   StorageFile loadFile = await Tools.AppInstallFolder.GetFileAsync(srcFileName);
   RasterImage image = await codecs.LoadAsync(LeadStreamFactory.Create(loadFile));

   // Prepare the command
   HalfTonePatternCommand command  = new HalfTonePatternCommand();
   command.Contrast = 100;
   command.Ripple = 200;
   command.AngleContrast = 12;
   command.AngleRipple = 2;
   command.AngleOffset = 4500;
   command.BackGroundColor = RasterColorHelper.Create(255, 255, 255);
   command.ForeGroundColor = RasterColorHelper.Create(255, 0,0);
   command.Type = HalfTonePatternCommandType.Line;
   command.Run(image);

}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

HalfTonePatternCommand Members
Leadtools.ImageProcessing.Core Namespace
Color Halftone and Halftone Images
Leadtools.ImageProcessing.GrayscaleCommand
Leadtools.ImageProcessing.Color.GrayScaleExtendedCommand
Leadtools.ImageProcessing.Color.AutoColorLevelCommand
Leadtools.ImageProcessing.Color.ColorLevelCommand
CorrelationCommand Class
Leadtools.ImageProcessing.Color.GrayScaleToDuotoneCommand
Leadtools.ImageProcessing.Color.GrayScaleToMultitoneCommand
Leadtools.ImageProcessing.Effects.RegionHolesRemovalCommand
Leadtools.ImageProcessing.Color.SelectiveColorCommand
Leadtools.ImageProcessing.Effects.SkeletonCommand
HalfToneCommand Class
Leadtools.ImageProcessing.SpecialEffects.PointillistCommand
Leadtools.ImageProcessing.Effects.ColorHalftoneCommand
Leadtools.ImageProcessing.Color.ColorSeparateCommand
Leadtools.ImageProcessing.Color.ColorMergeCommand
Leadtools.ImageProcessing.Color.DesaturateCommand
Leadtools.ImageProcessing.Effects.StatisticsInformationCommand
Leadtools.ImageProcessing.Color.HistogramCommand
Leadtools.ImageProcessing.Color.ColorCountCommand
MinMaxBitsCommand Class
MinMaxValuesCommand Class
Leadtools.ImageProcessing.Color.ConvertToColoredGrayCommand
ColorizeGrayCommand Class
ShiftDataCommand Class
SelectDataCommand Class
WindowLevelCommand Class
WindowLevelCommand Class
Leadtools.RasterPalette.WindowLevelFillLookupTable(Leadtools.RasterColor[],Leadtools.RasterColor,Leadtools.RasterColor,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,Leadtools.RasterPaletteWindowLevelFlags)

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.