LEADTOOLS画像処理(Leadtools.ImageProcessing.Coreアセンブリ)

フレームを表示

SmoothCommandEventArgsコンストラクタ(SmoothCommandEventArgs)








影響を受けるimageを参照文に引用するRasterImageオブジェクト。
バンプを削除するべきであるか、裂け目に設定するべきかどうかについて示す値。
バンプまたは裂け目の開始している行。行はゼロから始まります。
バンプまたは裂け目の開始している列。コラムはゼロから始まります。
バンプまたは裂け目のlength(ピクセル単位で)。
なめらかにされている要素が垂直か水平であるかどうかについて示すフラグ。
明示的なパラメータで新しいSmoothCommandクラスオブジェクトを初期化します。
構文
'Declaration
 
Public Function New( _
   ByVal image As RasterImage, _
   ByVal bumpNick As SmoothCommandBumpNickType, _
   ByVal startRow As Integer, _
   ByVal startColumn As Integer, _
   ByVal length As Integer, _
   ByVal direction As SmoothCommandDirectionType _
)
'Usage
 
Dim image As RasterImage
Dim bumpNick As SmoothCommandBumpNickType
Dim startRow As Integer
Dim startColumn As Integer
Dim length As Integer
Dim direction As SmoothCommandDirectionType
 
Dim instance As New SmoothCommandEventArgs(image, bumpNick, startRow, startColumn, length, direction)
public SmoothCommandEvent(
   Object source,
   RasterImage image, 
   SmoothCommandBumpNickType bumpNick, 
   int startRow, 
   int startColumn, 
   int length, 
   SmoothCommandDirectionType direction
)
            
function SmoothCommandEventArgs( 
   image ,
   bumpNick ,
   startRow ,
   startColumn ,
   length ,
   direction 
)

パラメーター

image
影響を受けるimageを参照文に引用するRasterImageオブジェクト。
bumpNick
バンプを削除するべきであるか、裂け目に設定するべきかどうかについて示す値。
startRow
バンプまたは裂け目の開始している行。行はゼロから始まります。
startColumn
バンプまたは裂け目の開始している列。コラムはゼロから始まります。
length
バンプまたは裂け目のlength(ピクセル単位で)。
方向
なめらかにされている要素が垂直か水平であるかどうかについて示すフラグ。
サンプル

imageの上でSmoothCommandを実行します。

Copy Code  
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing.Core

Public WithEvents smoothEventExample_S4 As SmoothCommand
   
Public Sub SmoothCommandEventArgsExample()
   Dim codecs As New RasterCodecs()
   codecs.ThrowExceptionsOnInvalidImages = True
   Dim leadImage As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Clean.tif"))

   ' Prepare the command
   smoothEventExample_S4 = New SmoothCommand(SmoothCommandFlags.FavorLong Or SmoothCommandFlags.SingleRegion Or SmoothCommandFlags.LeadRegion, 2)
   smoothEventExample_S4.Run(leadImage)

End Sub

Private Sub SmoothEventExample_SmoothCommand(ByVal sender As Object, ByVal e As SmoothCommandEventArgs) Handles smoothEventExample_S4.Smooth
   Dim ee As SmoothCommandEventArgs = New SmoothCommandEventArgs(e.Image, e.BumpNick, e.StartRow, e.StartColumn, e.Length, e.Direction)

   Dim BumpOrNeck As String
   If (ee.BumpNick = SmoothCommandBumpNickType.Bump) Then
      BumpOrNeck = "Bump"
   Else
      BumpOrNeck = "Neck"
   End If

   Dim Direction As String
   If (ee.Direction = SmoothCommandDirectionType.Horizontal) Then
      Direction = "Horizontal"
   Else
      Direction = "Vertical"
   End If

   e.Status = RemoveStatus.Remove

   MessageBox.Show("The width of the image is: " & e.Image.Width & Chr(13) & "The height of the image is: " & e.Image.Height & Chr(13) & " Bump Or Neck : " & BumpOrNeck & Chr(13) & "Direction : " & Direction)
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.Core;

      
public void SmoothCommandEventArgsExample()
{
   // Load an image
   RasterCodecs codecs = new RasterCodecs();
   codecs.ThrowExceptionsOnInvalidImages = true;
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "clean.tif"));

   // Prepare the command
   SmoothCommand command = new SmoothCommand(SmoothCommandFlags.FavorLong | SmoothCommandFlags.SingleRegion | SmoothCommandFlags.LeadRegion, 2);
   command.Smooth += new EventHandler<SmoothCommandEventArgs>(SmoothEventExample_S4);
   command.Run(image);

}

private void SmoothEventExample_S4(object sender, SmoothCommandEventArgs e)
{
   SmoothCommandEventArgs ee = new SmoothCommandEventArgs(e.Image, e.BumpNick, e.StartRow, e.StartColumn, e.Length, e.Direction);

   string BumpOrNeck;
   if (ee.BumpNick == SmoothCommandBumpNickType.Bump)
      BumpOrNeck = "Bump";
   else
      BumpOrNeck = "Neck";

   string Direction;
   if (ee.Direction == SmoothCommandDirectionType.Horizontal)
      Direction = "Horizontal";
   else
      Direction = "Vertical";

   e.Status = RemoveStatus.Remove;

   MessageBox.Show("The width of the image is: " + e.Image.Width + "\n" + "The height of the image is: " + e.Image.Height + "\n" + " Bump Or Neck : " + BumpOrNeck + "\n" + "Direction : " + Direction);
}

static class LEAD_VARS
{
public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
}
function SmoothCommandEventArgsExample() {
   var codecs = new Leadtools.Codecs.RasterCodecs();
   codecs.throwExceptionsOnInvalidImages = true;

   // Load the image
   var srcFileName = "Assets\\Clean.tif";
   var processedImage;
   return Tools.AppInstallFolder().getFileAsync(srcFileName).then(function (loadFile) {
      return codecs.loadAsync(Leadtools.LeadStreamFactory.create(loadFile));
   }).then(function (image) {
      // Prepare the command
      with (Leadtools.ImageProcessing.Core) {
         var command = new SmoothCommand(SmoothCommandFlags.favorLong | SmoothCommandFlags.singleRegion | SmoothCommandFlags.leadRegion, 2);
         command.addEventListener("smooth", SmoothEventExample_S4);
         command.run(image);
      }
   });
}

function SmoothEventExample_S4(e) {
   with (Leadtools.ImageProcessing.Core) {
      var ee = new SmoothCommandEventArgs(e.image, e.bumpNick, e.startRow, e.startColumn, e.length, e.direction);

      var BumpOrNeck;
      if (ee.bumpNick == SmoothCommandBumpNickType.bump)
         BumpOrNeck = "Bump";
      else
         BumpOrNeck = "Neck";

      var Direction;
      if (ee.direction == SmoothCommandDirectionType.horizontal)
         Direction = "Horizontal";
      else
         Direction = "Vertical";

      e.status = RemoveStatus.remove;

      console.error("The width of the image is: " + e.image.width + "\n" + "The height of the image is: " + e.image.height + "\n" + "Bump Or Neck : " + BumpOrNeck + "\n" + "Direction : " + Direction);
   }
}
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Core;

      
public async Task SmoothCommandEventArgsExample()
{
   // Load an image
   RasterCodecs codecs = new RasterCodecs();
   codecs.ThrowExceptionsOnInvalidImages = true;
   // Load the image
   string srcFileName = @"Assets\Clean.tif";
   StorageFile loadFile = await Tools.AppInstallFolder.GetFileAsync(srcFileName);
   RasterImage image = await codecs.LoadAsync(LeadStreamFactory.Create(loadFile));

   // Prepare the command
   SmoothCommand command = new SmoothCommand(SmoothCommandFlags.FavorLong | SmoothCommandFlags.SingleRegion | SmoothCommandFlags.LeadRegion, 2);
   command.Smooth += new EventHandler<SmoothCommandEventArgs>(SmoothEventExample_S4);
   command.Run(image);

}

private void SmoothEventExample_S4(object sender, SmoothCommandEventArgs e)
{
   SmoothCommandEventArgs ee = new SmoothCommandEventArgs(e.Image, e.BumpNick, e.StartRow, e.StartColumn, e.Length, e.Direction);

   string BumpOrNeck;
   if (ee.BumpNick == SmoothCommandBumpNickType.Bump)
      BumpOrNeck = "Bump";
   else
      BumpOrNeck = "Neck";

   string Direction;
   if (ee.Direction == SmoothCommandDirectionType.Horizontal)
      Direction = "Horizontal";
   else
      Direction = "Vertical";

   e.Status = RemoveStatus.Remove;

   Debug.WriteLine("The width of the image is: " + e.Image.Width + "\n" + "The height of the image is: " + e.Image.Height + "\n" + " Bump Or Neck : " + BumpOrNeck + "\n" + "Direction : " + Direction);
}
using Leadtools;
using Leadtools.Examples;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Core;

public void SmoothCommandEventArgsExample(RasterImage image)
{
   // Load an image
   RasterCodecs codecs = new RasterCodecs();
   codecs.ThrowExceptionsOnInvalidImages = true;

   // Prepare the command
   SmoothCommand command = new SmoothCommand(SmoothCommandFlags.FavorLong | SmoothCommandFlags.SingleRegion | SmoothCommandFlags.LeadRegion, 2);
   command.Smooth += new EventHandler<SmoothCommandEventArgs>(SmoothEventExample_S4);
   command.Run(image);
}

private void SmoothEventExample_S4(object sender, SmoothCommandEventArgs e)
{
   SmoothCommandEventArgs ee = new SmoothCommandEventArgs(e.Image, e.BumpNick, e.StartRow, e.StartColumn, e.Length, e.Direction);

   string BumpOrNeck;
   if (ee.BumpNick == SmoothCommandBumpNickType.Bump)
      BumpOrNeck = "Bump";
   else
      BumpOrNeck = "Neck";

   string Direction;
   if (ee.Direction == SmoothCommandDirectionType.Horizontal)
      Direction = "Horizontal";
   else
      Direction = "Vertical";

   e.Status = RemoveStatus.Remove;

   Debug.WriteLine("The width of the image is: " + e.Image.Width + "\n" + "The height of the image is: " + e.Image.Height + "\n" + " Bump Or Neck : " + BumpOrNeck + "\n" + "Direction : " + Direction);
}
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing.Core

Public Sub SmoothCommandEventArgsExample(ByVal image As RasterImage)
   ' Load an image
   Dim codecs As RasterCodecs = New RasterCodecs()
   codecs.ThrowExceptionsOnInvalidImages = True

   ' Prepare the command
   Dim command As SmoothCommand = New SmoothCommand(SmoothCommandFlags.FavorLong Or SmoothCommandFlags.SingleRegion Or SmoothCommandFlags.LeadRegion, 2)
   AddHandler command.Smooth, AddressOf SmoothEventExample_S4
   command.Run(image)
End Sub

Private Sub SmoothEventExample_S4(ByVal sender As Object, ByVal e As SmoothCommandEventArgs)
   Dim ee As SmoothCommandEventArgs = New SmoothCommandEventArgs(e.Image, e.BumpNick, e.StartRow, e.StartColumn, e.Length, e.Direction)

   Dim BumpOrNeck As String
   If ee.BumpNick = SmoothCommandBumpNickType.Bump Then
      BumpOrNeck = "Bump"
   Else
      BumpOrNeck = "Neck"
   End If

   Dim Direction As String
   If ee.Direction = SmoothCommandDirectionType.Horizontal Then
      Direction = "Horizontal"
   Else
      Direction = "Vertical"
   End If

   e.Status = RemoveStatus.Remove

   Debug.WriteLine("The width of the image is: " & e.Image.Width + Constants.vbLf & "The height of the image is: " & e.Image.Height + Constants.vbLf & _
                   " Bump Or Neck : " & BumpOrNeck & Constants.vbLf & "Direction : " & Direction)
End Sub
必要条件

ターゲットプラットホーム

参照

参照

SmoothCommandEventArgsクラス
SmoothCommandEventArgsメンバ