LEADTOOLS Image Processing (Leadtools.ImageProcessing.SpecialEffects assembly)

DiffuseGlowCommand Constructor(Int32,Int32,Int32,Int32,RasterColor)

Show in webframe
Example 







Glow intensity, expressed in tenths of a percent. Possible values range from -1000 - 1000. Use positive values to add glow to the brighter regions of the image, and negative values to add glow to the darker regions of the image.
Value that represents how deeply the glow will penetrate into the non-glowing areas, expressed in tenths of a percent. Possible values range from 0 - 1000. A value of 0 indicates total glow diffusion, whereas a value of 1000 indicates the glow does not penetrate into any of the non-glowing areas.
Value that represents the amount of blur in the glow diffusion, from 0 to 100 pixels. Possible values range from 0 - 1000. A value of 0 indicates none of the glow is diffused, whereas a value of 1000 indicates maximum diffusion.
Percent of the image to be covered with added pixels, expressed in tenths of a percent. The pixels will be added randomly. Possible values range from 0 - 1000.
The RasterColor value that specifies the glow color.
Initializes a new DiffuseGlowCommand class object with explicit parameters.
Syntax
public DiffuseGlowCommand( 
   int glowAmount,
   int clearAmount,
   int spreadAmount,
   int whiteNoiseRange,
   RasterColor glowColor
)
'Declaration
 
Public Function New( _
   ByVal glowAmount As Integer, _
   ByVal clearAmount As Integer, _
   ByVal spreadAmount As Integer, _
   ByVal whiteNoiseRange As Integer, _
   ByVal glowColor As RasterColor _
)
'Usage
 
Dim glowAmount As Integer
Dim clearAmount As Integer
Dim spreadAmount As Integer
Dim whiteNoiseRange As Integer
Dim glowColor As RasterColor
 
Dim instance As New DiffuseGlowCommand(glowAmount, clearAmount, spreadAmount, whiteNoiseRange, glowColor)
public DiffuseGlowCommand( 
   int glowAmount,
   int clearAmount,
   int spreadAmount,
   int whiteNoiseRange,
   RasterColor glowColor
)

            

            
function DiffuseGlowCommand( 
   glowAmount ,
   clearAmount ,
   spreadAmount ,
   whiteNoiseRange ,
   glowColor 
)
public:
DiffuseGlowCommand( 
   int glowAmount,
   int clearAmount,
   int spreadAmount,
   int whiteNoiseRange,
   RasterColor glowColor
)

Parameters

glowAmount
Glow intensity, expressed in tenths of a percent. Possible values range from -1000 - 1000. Use positive values to add glow to the brighter regions of the image, and negative values to add glow to the darker regions of the image.
clearAmount
Value that represents how deeply the glow will penetrate into the non-glowing areas, expressed in tenths of a percent. Possible values range from 0 - 1000. A value of 0 indicates total glow diffusion, whereas a value of 1000 indicates the glow does not penetrate into any of the non-glowing areas.
spreadAmount
Value that represents the amount of blur in the glow diffusion, from 0 to 100 pixels. Possible values range from 0 - 1000. A value of 0 indicates none of the glow is diffused, whereas a value of 1000 indicates maximum diffusion.
whiteNoiseRange
Percent of the image to be covered with added pixels, expressed in tenths of a percent. The pixels will be added randomly. Possible values range from 0 - 1000.
glowColor
The RasterColor value that specifies the glow color.
Example
Copy Code  
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing.SpecialEffects

Public Sub DiffuseGlowConstructorExample()
   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 fillColor As New RasterColor(255, 255, 255)
   Dim command As New DiffuseGlowCommand(50, 50, 10, 10, fillColor)
   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
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.SpecialEffects;

public void DiffuseGlowConstructorExample()
{
   // 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 fillColor = new RasterColor(255, 255, 255) ;
   DiffuseGlowCommand command = new DiffuseGlowCommand(50, 50, 10, 10, fillColor);
   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;

[TestMethod]
public async Task DiffuseGlowConstructorExample()
{
   // 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 fillColor = RasterColorHelper.Create(255, 255, 255) ;
   DiffuseGlowCommand command = new DiffuseGlowCommand(50, 50, 10, 10, fillColor);
   command.Run(image);

   string destFileName = @"result.bmp";
   StorageFile saveFile = await Tools.AppLocalFolder.CreateFileAsync(destFileName);
   await codecs.SaveAsync(image, LeadStreamFactory.Create(saveFile), RasterImageFormat.Bmp, 24);
}
Requirements

Target Platforms

See Also

Reference

DiffuseGlowCommand Class
DiffuseGlowCommand Members
Overload List

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.