Leadtools.ImageProcessing.SpecialEffects Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.12.11
FreePlaneBendCommand Class
See Also  Members   Example 
Leadtools.ImageProcessing.SpecialEffects Namespace : FreePlaneBendCommand Class




Wraps the image onto a 3D plane shaped by Curve. This command is available in the Raster Pro and above toolkits.

Syntax

Visual Basic (Declaration) 
Public Class FreePlaneBendCommand 
   Inherits RasterCommand
   Implements IRasterCommand 
Visual Basic (Usage)Copy Code
Dim instance As FreePlaneBendCommand
C# 
public class FreePlaneBendCommand : RasterCommand, IRasterCommand  
Managed Extensions for C++ 
public __gc class FreePlaneBendCommand : public RasterCommand, IRasterCommand  
C++/CLI 
public ref class FreePlaneBendCommand : public RasterCommand, IRasterCommand  

Example

Visual BasicCopy Code
ImageProcessing.SpecialEffects.FreePlaneBendCommand
   Public Sub FreePlaneBendCommandExample()
      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 command As FreePlaneBendCommand = New FreePlaneBendCommand
      Dim UserPoint() As Point
      ReDim UserPoint(3)

      Dim Curve() As Integer
      ReDim Curve(12)

      'Apply the filter
      UserPoint(0).X = 0
      UserPoint(0).Y = 0
      UserPoint(1).X = 3
      UserPoint(1).Y = 10
      UserPoint(2).X = 9
      UserPoint(2).Y = -10
      UserPoint(3).X = 12
      UserPoint(3).Y = 0

      EffectsUtilities.GetCurvePoints(Curve, UserPoint, CurvePointsType.Linear)
      command.Flags = FreePlaneBendCommandFlags.Color Or FreePlaneBendCommandFlags.Vertical
      command.Scale = 200
      command.FillColor = New RasterColor(255, 0, 0)
      command.Curve = Curve
      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.FreePlaneBendCommand 
      public void FreePlaneBendCommandExample() 
      { 
         // 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 
         FreePlaneBendCommand command = new FreePlaneBendCommand(); 
         System.Drawing.Point[] UserPoint = new System.Drawing.Point[4]; 
         int[] Curve = new int[13]; 
 
         //Apply the filter 
         UserPoint[0].X = 0; 
         UserPoint[0].Y = 0; 
         UserPoint[1].X = 3; 
         UserPoint[1].Y = 10; 
         UserPoint[2].X = 9; 
         UserPoint[2].Y = -10; 
         UserPoint[3].X = 12; 
         UserPoint[3].Y = 0;  
 
         EffectsUtilities.GetCurvePoints(Curve, UserPoint, CurvePointsType.Linear); 
         for(int i = 0; i < Curve.Length; i++) 
            Curve[i] /= 50; 
         command.Flags = FreePlaneBendCommandFlags.Color | FreePlaneBendCommandFlags.Vertical; 
         command.Scale = 200; 
         command.FillColor = new RasterColor(255, 0, 0); 
         command.Curve = Curve; 
         command.Run(image); 
         codecs.Save(image, @"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Result.jpg", RasterImageFormat.Jpeg, 24); 
 
         RasterCodecs.Shutdown(); 
      }

Remarks

  • If the image has a region, the effect will be applied on the region only.
  • For an example, the following figure shows an image before the effect is applied.

    The following figure shows the same image after the effect has been applied.
  • This command supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.
  • This command does not support signed data images.
  • This command does not support 32-bit grayscale images.

Inheritance Hierarchy

System.Object
   Leadtools.ImageProcessing.RasterCommand
      Leadtools.ImageProcessing.SpecialEffects.FreePlaneBendCommand

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