Initializes a new ColoredBallsCommand with explicit parameters.
public ColoredBallsCommand(int numberOfBalls,int size,int sizeVariation,int highLightAngle,Leadtools.RasterColor highLightColor,Leadtools.RasterColor backGroundColor,Leadtools.RasterColor shadingColor,int ripple,Leadtools.RasterColor[] ballColors,int ballColorOpacity,int ballColorOpacityVariation,Leadtools.Imageprocessing.Specialeffects.ColoredBallsCommandFlags flags)
Public Function New( _ByVal numberOfBalls As Integer, _ByVal size As Integer, _ByVal sizeVariation As Integer, _ByVal highLightAngle As Integer, _ByVal highLightColor As Leadtools.RasterColor, _ByVal backGroundColor As Leadtools.RasterColor, _ByVal shadingColor As Leadtools.RasterColor, _ByVal ripple As Integer, _ByVal ballColors() As Leadtools.RasterColor, _ByVal ballColorOpacity As Integer, _ByVal ballColorOpacityVariation As Integer, _ByVal flags As Leadtools.Imageprocessing.Specialeffects.ColoredBallsCommandFlags _)
public ColoredBallsCommand(int numberOfBalls,int size,int sizeVariation,int highLightAngle,Leadtools.RasterColor highLightColor,Leadtools.RasterColor backGroundColor,Leadtools.RasterColor shadingColor,int ripple,Leadtools.RasterColor[] ballColors,int ballColorOpacity,int ballColorOpacityVariation,Leadtools.Imageprocessing.Specialeffects.ColoredBallsCommandFlags flags)
function ColoredBallsCommand(numberOfBalls ,size ,sizeVariation ,highLightAngle ,highLightColor ,backGroundColor ,shadingColor ,ripple ,ballColors ,ballColorOpacity ,ballColorOpacityVariation ,flags)
public:ColoredBallsCommand(int numberOfBalls,int size,int sizeVariation,int highLightAngle,Leadtools.RasterColor highLightColor,Leadtools.RasterColor backGroundColor,Leadtools.RasterColor shadingColor,int ripple,Leadtools.array<RasterColor>^ ballColors,int ballColorOpacity,int ballColorOpacityVariation,Leadtools.Imageprocessing.Specialeffects.ColoredBallsCommandFlags flags)
numberOfBalls
Number of balls that will be drawn in the image. Only positive values are accepted.
size
Average balls size, in pixels. Only positive values are accepted.
sizeVariation
Balls size variation. Valid values range from 0 to 100. Use 0 to have all balls the same size. Use 100 to have the size vary from 0 to 2 X uSize.
highLightAngle
Light source direction of the highlight color on the ball. This value is in hundredths of degrees (+/-). A positive value will rotate the highlight color clockwise, while a negative value will rotate the highlight color counter-clockwise. Valid values range from -36000 to + 36000.
highLightColor
Highlight color.
backGroundColor
Background color.
shadingColor
Shade (or gradient) color.
ripple
The number of shades that are used to produce the background. This value is divided internally by 100. For example, if lRipple = 200 the actual frequency is 2.
ballColors
An array of ball colors.
ballColorOpacity
Average ball color opacity. Valid values range from: 0 to 255 for 8-bit, 0 to 4095 for 12-bit, 0 to 65535 for 16-bit.
ballColorOpacityVariation
Ball color opacity variation. Valid values range from 0 to 100. Use 0 to have all pixels assigned the same opacity. Use 100 to have the opacity vary from 0 to 2 X ballColorOpacity.
flags
Enumeration that indicates the background color , shade (or gradient) type, ball type and ball color type.
Run the ColoredBallsCommand on an image.
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.ImageProcessing.SpecialEffects<TestMethod()> _Public Sub ColoredBallsConstructorExample()Dim codecs As New RasterCodecs()codecs.ThrowExceptionsOnInvalidImages = TrueDim leadImage As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "cannon.jpg"))' Prepare the commandDim ballColors() As RasterColorReDim ballColors(3)ballColors(0) = New RasterColor(255, 128, 64)ballColors(1) = New RasterColor(160, 80, 255)ballColors(2) = New RasterColor(64, 255, 100)ballColors(3) = New RasterColor(100, 255, 255)Dim command As New ColoredBallsCommand(1000, 15, 10, 4500, _New RasterColor(255, 255, 255), _New RasterColor(255, 0, 0), _New RasterColor(255, 255, 0), _200, ballColors, 64, 25, _ColoredBallsCommandFlags.ShadingCircular Or _ColoredBallsCommandFlags.Sticker Or _ColoredBallsCommandFlags.BackGroundImage Or _ColoredBallsCommandFlags.BallsColorOpacity)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
using Leadtools;using Leadtools.Codecs;using Leadtools.ImageProcessing.SpecialEffects;public void ColoredBallsConstructorExample(){// Load an imageRasterCodecs codecs = new RasterCodecs();codecs.ThrowExceptionsOnInvalidImages = true;RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "cannon.jpg"));// Prepare the commandRasterColor [] ballColors = new RasterColor[4];ballColors[0] = new RasterColor(255,128,64);ballColors[1] = new RasterColor(160,80,255);ballColors[2] = new RasterColor(64,255,100);ballColors[3] = new RasterColor(100,255,255);ColoredBallsCommand command = new ColoredBallsCommand(1000, 15, 10, 4500,new RasterColor(255, 255, 255),new RasterColor(255, 0, 0),new RasterColor(255, 255, 0),200, ballColors, 64, 25,ColoredBallsCommandFlags.ShadingCircular |ColoredBallsCommandFlags.Sticker |ColoredBallsCommandFlags.BackGroundImage |ColoredBallsCommandFlags.BallsColorOpacity);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";}
using Leadtools;using Leadtools.Codecs;using Leadtools.ImageProcessing.SpecialEffects;public async Task ColoredBallsConstructorExample(){// Load an imageRasterCodecs codecs = new RasterCodecs();codecs.ThrowExceptionsOnInvalidImages = true;string srcFileName = @"Assets\Image1.cmp";StorageFile loadFile = await Tools.AppInstallFolder.GetFileAsync(srcFileName);RasterImage image = await codecs.LoadAsync(LeadStreamFactory.Create(loadFile));// Prepare the commandRasterColor [] ballColors = new RasterColor[4];ballColors[0] = RasterColorHelper.Create(255,128,64);ballColors[1] = RasterColorHelper.Create(160,80,255);ballColors[2] = RasterColorHelper.Create(64,255,100);ballColors[3] = RasterColorHelper.Create(100,255,255);ColoredBallsCommand command = new ColoredBallsCommand(1000, 15, 10, 4500,RasterColorHelper.Create(255, 255, 255),RasterColorHelper.Create(255, 0, 0),RasterColorHelper.Create(255, 255, 0),200, ballColors, 64, 25,ColoredBallsCommandFlags.ShadingCircular |ColoredBallsCommandFlags.Sticker |ColoredBallsCommandFlags.BackGroundImage |ColoredBallsCommandFlags.BallsColorOpacity);command.Run(image);string destFileName = @"result.bmp";StorageFile saveFile = await Tools.AppLocalFolder.CreateFileAsync(destFileName);await codecs.SaveAsync(image, LeadStreamFactory.Create(saveFile), RasterImageFormat.Bmp, 24);}

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
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.