(Leadtools.Controls)

フレームを表示

ImageViewerActiveItemInteractiveModeクラス




メンバ 
キーボードまたはマウス/タッチを用いてビューワで現在のアクティブな項目を変更することができます。
オブジェクトモデル
構文
public class ImageViewerActiveItemInteractiveMode : ImageViewerInteractiveMode 
'Declaration
 
Public Class ImageViewerActiveItemInteractiveMode 
   Inherits ImageViewerInteractiveMode
解説

ImageViewerActiveItemInteractiveModeImageViewerInteractiveModeから派生し、InteractiveServiceの以下のイベントにサブスクライブします。

ImageViewerActiveItemInteractiveModeは、以下のように現在のActiveItemを変更します:

詳細については、「画像ビューワの対話モード」を参照してください。

サンプル
Copy Code  
Imports Leadtools
Imports Leadtools.Controls
Imports Leadtools.Codecs
Imports Leadtools.Drawing
Imports Leadtools.ImageProcessing
Imports Leadtools.ImageProcessing.Color

<TestMethod>
Public Sub ImageViewerActiveItemInteractiveModeExample()
   _imageViewer.InteractiveModes.BeginUpdate()
   Dim mode As New MyImageViewerInteractivMode
   mode.IsHoverEnabled = True
   mode.IsKeyboardEnabled = True
   _imageViewer.InteractiveModes.Add(mode)
   _imageViewer.InteractiveModes.EndUpdate()
End Sub
Public Class MyImageViewerInteractivMode : Inherits ImageViewerActiveItemInteractiveMode
   Public Sub New()
   End Sub

   Public Overrides ReadOnly Property Name() As String
      Get
         Return "MyImageViewerInteractivMode"
      End Get
   End Property

   Public Overrides ReadOnly Property Id() As Integer
      Get
         Return ImageViewerInteractiveMode.UserModeId
      End Get
   End Property

   Public Overrides Sub Start(ByVal imageViewer As ImageViewer)
      MyBase.Start(imageViewer)
      Dim service As InteractiveService = MyBase.InteractiveService
      AddHandler service.Tap, AddressOf service_Tap
   End Sub

   Public Overrides Sub [Stop](ByVal imageViewer As ImageViewer)
      If IsStarted Then
         Dim service As InteractiveService = MyBase.InteractiveService
         RemoveHandler service.Tap, AddressOf service_Tap
         MyBase.Stop(imageViewer)
      End If
   End Sub

   Private Sub service_Tap(ByVal sender As Object, ByVal e As InteractiveEventArgs)
      If CanStartWork(e) Then
         e.IsHandled = True
         OnWorkStarted(EventArgs.Empty)

         Dim imageViewer As ImageViewer = Me.ImageViewer

         imageViewer.BeginRender()
         ' ...
         ' ...
         ' ...
         ' set your render code here
         ' ...
         ' ...
         ' ...
         imageViewer.EndRender()

         OnWorkCompleted(EventArgs.Empty)
      End If
   End Sub
End Class
using Leadtools;
using Leadtools.Controls;
using Leadtools.Codecs;
using Leadtools.Drawing;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Color;

public void ImageViewerActiveItemInteractiveModeExample()
{
   _imageViewer.InteractiveModes.BeginUpdate();
   _imageViewer.InteractiveModes.Add(new MyImageViewerInteractivMode { IsHoverEnabled = true, IsKeyboardEnabled = true });
   _imageViewer.InteractiveModes.EndUpdate();
}
必要条件

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

参照

参照

ImageViewerActiveItemInteractiveModeメンバ
Leadtools.Controls名前空間