←Select platform

LensFlareCommand Constructor(LeadPoint,int,LensFlareCommandType,RasterColor)

Summary
Initializes a new LensFlareCommand class object with explicit parameters.
Syntax
C#
C++/CLI
Python
public: 
LensFlareCommand(  
   LeadPoint centerPoint, 
   int brightness, 
   LensFlareCommandType type, 
   RasterColor color 
) 
__init__(self,centerPoint,brightness,type,color) # Overloaded constructor 

Parameters

centerPoint
Point around which the effect is centered.

brightness
The brightness of the flare. This value is divided internally by 100. This parameter affects the brightness of both the flare, and any lightened circles surrounding the flare. This parameter only accepts positive values.

type
Flag that indicates the lens type.

color
Specifies the color of the main flare.

Example

Run the LensFlareCommand on an image.

C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.SpecialEffects; 
 
 
public void LensFlareConstructorExample() 
{ 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "sample5.cmp")); 
 
   // Prepare the command 
   LensFlareCommand command = new LensFlareCommand(new LeadPoint(image.Width / 4, image.Height / 4), 100, LensFlareCommandType.Type1, new RasterColor(100, 150, 10)); 
   // Apply the lens flare effect to the image. 
   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:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

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

Leadtools.ImageProcessing.SpecialEffects Assembly

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