Leadtools.ImageProcessing.SpecialEffects Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.12.11
RingEffectCommand Constructor(Point,Int32,Int32,Int32,RasterColor,Int32,RingEffectCommandFlags)
See Also  Example
Leadtools.ImageProcessing.SpecialEffects Namespace > RingEffectCommand Class > RingEffectCommand Constructor : RingEffectCommand Constructor(Point,Int32,Int32,Int32,RasterColor,Int32,RingEffectCommandFlags)




origin
Represents the coordinates (in pixels) for the origin of the rings. Only positive values are accepted.
radius
If the RingEffectCommandFlags.Radius flag is set, this is the width of each ring, in pixels. If the RingEffectCommandFlags.MaxRadius flag is set, this is the maximum radius, in pixels. In this latter case, the width of each ring is equal to ((radius) / (ringCount + 1)). Only positive values are accepted.
ringCount
Number of rings. Only positive values are accepted.
randomize
The starting point for the randomization process. Valid range is 0-500. If 0, the command will pick the starting point. If > 0, this value will be the starting point. Only positive values are accepted.
color
Color used to fill the undefined area. This parameter is used only if the RingEffectCommandFlags.Color flag is set.
angle
The rotation angle value for each ring compared to the inner ring, in hundredths of degrees. This parameter is used only if the RingEffectCommandFlags.FixedAngle flag. The range of the acceptable values is from -18000 to 18000. This value is divided internally by 100.
flags
Flags which control the behavior of this command. These flags can be OR-ed together, unless otherwise specified.
Initializes a new RingEffectCommand class object with explicit parameters.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal origin As Point, _
   ByVal radius As Integer, _
   ByVal ringCount As Integer, _
   ByVal randomize As Integer, _
   ByVal color As RasterColor, _
   ByVal angle As Integer, _
   ByVal flags As RingEffectCommandFlags _
)
Visual Basic (Usage)Copy Code
Dim origin As Point
Dim radius As Integer
Dim ringCount As Integer
Dim randomize As Integer
Dim color As RasterColor
Dim angle As Integer
Dim flags As RingEffectCommandFlags
 
Dim instance As RingEffectCommand(origin, radius, ringCount, randomize, color, angle, flags)
C# 
public RingEffectCommand( 
   Point origin,
   int radius,
   int ringCount,
   int randomize,
   RasterColor color,
   int angle,
   RingEffectCommandFlags flags
)
Managed Extensions for C++ 
public: RingEffectCommand( 
   Point origin,
   int radius,
   int ringCount,
   int randomize,
   RasterColor color,
   int angle,
   RingEffectCommandFlags flags
)
C++/CLI 
public:
RingEffectCommand( 
   Point origin,
   int radius,
   int ringCount,
   int randomize,
   RasterColor color,
   int angle,
   RingEffectCommandFlags flags
)

Parameters

origin
Represents the coordinates (in pixels) for the origin of the rings. Only positive values are accepted.
radius
If the RingEffectCommandFlags.Radius flag is set, this is the width of each ring, in pixels. If the RingEffectCommandFlags.MaxRadius flag is set, this is the maximum radius, in pixels. In this latter case, the width of each ring is equal to ((radius) / (ringCount + 1)). Only positive values are accepted.
ringCount
Number of rings. Only positive values are accepted.
randomize
The starting point for the randomization process. Valid range is 0-500. If 0, the command will pick the starting point. If > 0, this value will be the starting point. Only positive values are accepted.
color
Color used to fill the undefined area. This parameter is used only if the RingEffectCommandFlags.Color flag is set.
angle
The rotation angle value for each ring compared to the inner ring, in hundredths of degrees. This parameter is used only if the RingEffectCommandFlags.FixedAngle flag. The range of the acceptable values is from -18000 to 18000. This value is divided internally by 100.
flags
Flags which control the behavior of this command. These flags can be OR-ed together, unless otherwise specified.

Example

Visual BasicCopy Code
ImageProcessing.SpecialEffects.RingEffectCommand.RingEffectConstructor
   Public Sub RingEffectConstructorExample()
      RasterCodecs.Startup()
      Dim codecs As New RasterCodecs()
      codecs.ThrowExceptionsOnInvalidImages = True

      Dim leadImage As RasterImage = codecs.Load("C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Master.jpg")

      ' Prepare the command
      Dim origin As Point = New Point(CType((leadImage.Width \ 2), Integer), CType((leadImage.Height \ 2), Integer))
      Dim command As RingEffectCommand = New RingEffectCommand(origin, origin.X, 10, 0, New RasterColor(0, 0, 0), 100, RingEffectCommandFlags.Color Or RingEffectCommandFlags.FixedAngle Or RingEffectCommandFlags.MaxRadius)
      ' Apply a ring effect to this image with origin (Origin). The maximum ring radius is equal to half of the image's width. Draw 10 rings, fill the undefined areas with the Black color and the shift angle is equal to 1 degrees. Note that you will have undefined areas only if the image width is greater than the image height.
      command.Run(leadImage)
      codecs.Save(leadImage, "C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Result.jpg", RasterImageFormat.Jpeg, 24)

      RasterCodecs.Shutdown()
   End Sub
C#Copy Code
ImageProcessing.SpecialEffects.RingEffectCommand.RingEffectConstructor 
      public void RingEffectConstructorExample() 
      { 
         // Load an image 
         RasterCodecs.Startup(); 
         RasterCodecs codecs = new RasterCodecs(); 
         codecs.ThrowExceptionsOnInvalidImages = true; 
 
         RasterImage image = codecs.Load(@"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Master.jpg"); 
 
         // Prepare the command 
         Point origin = new Point((image.Width / 2),(image.Height / 2)); 
         RingEffectCommand command = new RingEffectCommand(origin, origin.X, 10, 0, new RasterColor(0,0,0), 100, RingEffectCommandFlags.Color | RingEffectCommandFlags.FixedAngle | RingEffectCommandFlags.MaxRadius); 
         // Apply a ring effect to this image with origin (Origin). The maximum ring radius is equal to half of the image's width. Draw 10 rings, fill the undefined areas with the Black color and the shift angle is equal to 1 degrees. Note that you will have undefined areas only if the image width is greater than the image height. 
         command.Run(image); 
         codecs.Save(image, @"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Result.jpg", RasterImageFormat.Jpeg, 24); 
 
         RasterCodecs.Shutdown(); 
      }

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also