←Select platform

HalfTonePatternCommand Constructor(int,int,int,int,int,RasterColor,RasterColor,HalfTonePatternCommandType)

Summary
Initializes a new HalfTonePatternCommand with explicit parameters.
Syntax
C#
Objective-C
C++/CLI
Python
- (instancetype)initWithValues:(NSInteger)contrast ripple:(NSInteger)ripple angleContrast:(NSInteger)angleContrast angleRipple:(NSInteger)angleRipple angleOffset:(NSInteger)angleOffset backgroundColor:(LTRasterColor*)backgroundColor foregroundColor:(LTRasterColor*)foregroundColor type:(LTHalfTonePatternCommandType)type NS_DESIGNATED_INITIALIZER; 

Parameters

contrast
Halftone pattern contrast. Increasing this value increases the pattern brightness, making it more visible.

ripple
Halftone pattern frequency. Internally, this value is divided by 100. For example, if ripple = 200 the actual frequency is 2. Increasing this value increases the number of dots, lines, etc. in the pattern.

angleContrast
Angular pattern contrast. Increasing this value increases brightness of the "spokes" in the image.

angleRipple
Angular pattern frequency. This value determines how many "spokes" appear in the image.

angleOffset
Angular pattern offset in hundredths of degrees (+/-). A positive value will rotate the screen clockwise, while a negative value will rotate the screen counter-clockwise.

foreGroundColor
Value that specifies the foreground color for any exposed areas.

backGroundColor
Value that specifies the background color for any exposed areas.

type
Value that indicates which halftone pattern type to use.

Example

Run the HalfTonePatternCommand on an image.

C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.Core; 
 
public void HalfTonePatternConstructorExample() 
{ 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "sample1.cmp")); 
 
   // Prepare the command 
   HalfTonePatternCommand command = new HalfTonePatternCommand(100, 200, 12, 2, 4500, 
      new RasterColor(255, 0, 0), 
      new RasterColor(255, 255, 255), 
      HalfTonePatternCommandType.Line); 
   command.Run(image); 
 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
Requirements

Target Platforms

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

Leadtools.ImageProcessing.Core Assembly

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