Leadtools.ImageProcessing.SpecialEffects Namespace > ColoredBallsCommand Class > ColoredBallsCommand Constructor : ColoredBallsCommand Constructor(Int32,Int32,Int32,Int32,RasterColor,RasterColor,RasterColor,Int32,RasterColor[],Int32,Int32,ColoredBallsCommandFlags) |
public ColoredBallsCommand( int numberOfBalls, int size, int sizeVariation, int highLightAngle, RasterColor highLightColor, RasterColor backGroundColor, RasterColor shadingColor, int ripple, RasterColor[] ballColors, int ballColorOpacity, int ballColorOpacityVariation, ColoredBallsCommandFlags flags )
'Declaration Public Function New( _ ByVal numberOfBalls As Integer, _ ByVal size As Integer, _ ByVal sizeVariation As Integer, _ ByVal highLightAngle As Integer, _ ByVal highLightColor As RasterColor, _ ByVal backGroundColor As RasterColor, _ ByVal shadingColor As RasterColor, _ ByVal ripple As Integer, _ ByVal ballColors() As RasterColor, _ ByVal ballColorOpacity As Integer, _ ByVal ballColorOpacityVariation As Integer, _ ByVal flags As ColoredBallsCommandFlags _ )
'Usage Dim numberOfBalls As Integer Dim size As Integer Dim sizeVariation As Integer Dim highLightAngle As Integer Dim highLightColor As RasterColor Dim backGroundColor As RasterColor Dim shadingColor As RasterColor Dim ripple As Integer Dim ballColors() As RasterColor Dim ballColorOpacity As Integer Dim ballColorOpacityVariation As Integer Dim flags As ColoredBallsCommandFlags Dim instance As New ColoredBallsCommand(numberOfBalls, size, sizeVariation, highLightAngle, highLightColor, backGroundColor, shadingColor, ripple, ballColors, ballColorOpacity, ballColorOpacityVariation, flags)
public ColoredBallsCommand( int numberOfBalls, int size, int sizeVariation, int highLightAngle, RasterColor highLightColor, RasterColor backGroundColor, RasterColor shadingColor, int ripple, RasterColor[] ballColors, int ballColorOpacity, int ballColorOpacityVariation, 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, RasterColor highLightColor, RasterColor backGroundColor, RasterColor shadingColor, int ripple, array<RasterColor>^ ballColors, int ballColorOpacity, int ballColorOpacityVariation, ColoredBallsCommandFlags flags )
Public Sub ColoredBallsConstructorExample() 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 ballColors() As RasterColor ReDim 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 Sub Public NotInheritable Class LEAD_VARS Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images" End Class
public void ColoredBallsConstructorExample() { // Load an image RasterCodecs codecs = new RasterCodecs(); codecs.ThrowExceptionsOnInvalidImages = true; RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Master.jpg")); // Prepare the command RasterColor [] 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"; }
[TestMethod] public async Task ColoredBallsConstructorExample() { // Load an image RasterCodecs 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 command RasterColor [] 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); }
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