アプリケーション内のインク以外のイメージが存在可能な 2 次元領域の ContextNode を表します。
名前空間 : Microsoft.Ink
アセンブリ : Microsoft.Ink.Analysis (Microsoft.Ink.Analysis.dll 内)
構文
'宣言
Public NotInheritable Class ImageNode _
Inherits ContextNode
'使用
Dim instance As ImageNode
public sealed class ImageNode : ContextNode
public ref class ImageNode sealed : public ContextNode
public final class ImageNode extends ContextNode
public final class ImageNode extends ContextNode
解説
InkAnalyzer は ImageNode オブジェクトを生成しません。アプリケーションは、ContextNode.CreateSubNode メソッドを使用して ImageNode オブジェクトをコンテキスト ノード ツリーに追加します。アナライザの状態が保持される場合、これらのノードも同様に保持できます。
将来的には、認識エンジンは ImageNode オブジェクトにより定義された領域を使用して、インク以外のイメージに注釈を作成しているインクがあるかどうかを調べることができます。
ImageNode には子を含めることができません。
例
次の例では、ImageNode オブジェクトを、PictureBox コントロール thePictureBox の InkAnalyzer、theInkAnalyzer, に追加します。また、PictureBox コントロールの位置を、ピクセル座標からインク座標に変換します。ImageNode オブジェクトの Data プロパティを、PictureBox の Image プロパティに設定します。
' Add image node
Dim pictureNode As ImageNode = _
theInkAnalyzer.RootNode.CreateSubNode(Microsoft.Ink.ContextNodeType.Image)
' Convert pixel coordinates to pixel coordinates
Dim pictureTopLeft As Point = thePictureBox.Location
Dim pictureBottomRight As New Point(thePictureBox.Right, thePictureBox.Bottom)
Dim panelGraphics As Graphics = theNotesPanel.CreateGraphics()
theInkCollector.Renderer.PixelToInkSpace(panelGraphics, pictureTopLeft)
theInkCollector.Renderer.PixelToInkSpace(panelGraphics, pictureBottomRight)
panelGraphics.Dispose()
' Set the ___location of the image node
pictureNode.SetLocation(New AnalysisRegion(New Rectangle(pictureTopLeft.X, _
pictureTopLeft.Y, pictureBottomRight.X - pictureTopLeft.X, _
pictureBottomRight.Y - pictureTopLeft.Y)))
' Serialize the image to a byte array and set ImageNode.Data to the array.
Using stream As System.IO.MemoryStream = New System.IO.MemoryStream()
thePictureBox.Image.Save(stream, thePictureBox.Image.RawFormat)
pictureNode.Data = stream.ToArray()
End Using
// Add image node
ImageNode pictureNode = (ImageNode)
theInkAnalyzer.RootNode.CreateSubNode(Microsoft.Ink.ContextNodeType.Image);
// Convert pixel coordinates to pixel coordinates
Point pictureTopLeft = thePictureBox.Location;
Point pictureBottomRight = new Point(thePictureBox.Right,
thePictureBox.Bottom);
Graphics panelGraphics = theNotesPanel.CreateGraphics();
theInkCollector.Renderer.PixelToInkSpace(panelGraphics, ref pictureTopLeft);
theInkCollector.Renderer.PixelToInkSpace(panelGraphics, ref pictureBottomRight);
panelGraphics.Dispose();
// Set the ___location of the image node
pictureNode.SetLocation(new AnalysisRegion(new Rectangle(pictureTopLeft.X,
pictureTopLeft.Y, pictureBottomRight.X - pictureTopLeft.X,
pictureBottomRight.Y - pictureTopLeft.Y)));
// Serialize the image to a byte array and set ImageNode.Data to the array.
using (System.IO.MemoryStream stream = new System.IO.MemoryStream())
{
thePictureBox.Image.Save(stream, thePictureBox.Image.RawFormat);
pictureNode.Data = stream.ToArray();
}
継承階層
System.Object
Microsoft.Ink.ContextNode
Microsoft.Ink.ImageNode
スレッド セーフ
この型のすべてのパブリック static (Visual Basic では Shared) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォーム
Windows Vista
.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。
バージョン情報
.NET Framework
サポート対象 : 3.0