Sdílet prostřednictvím


InkPicture Class

The InkPicture control provides the ability to place an image in an application and enable users to add ink on top of it. It is intended for scenarios in which ink is not recognized as text but is instead stored as ink.

Namespace:  Microsoft.Ink
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

Syntax

'Declaration
<PermissionSetAttribute(SecurityAction.InheritanceDemand, Name := "FullTrust")> _
<UIPermissionAttribute(SecurityAction.Demand, Window := UIPermissionWindow.SafeTopLevelWindows)> _
Public Class InkPicture _
    Inherits PictureBox
'Usage
Dim instance As InkPicture
[PermissionSetAttribute(SecurityAction.InheritanceDemand, Name = "FullTrust")]
[UIPermissionAttribute(SecurityAction.Demand, Window = UIPermissionWindow.SafeTopLevelWindows)]
public class InkPicture : PictureBox
[PermissionSetAttribute(SecurityAction::InheritanceDemand, Name = L"FullTrust")]
[UIPermissionAttribute(SecurityAction::Demand, Window = UIPermissionWindow::SafeTopLevelWindows)]
public ref class InkPicture : public PictureBox
public class InkPicture extends PictureBox

Remarks

Warning

You must call the Dispose method on this object before it goes out of scope. This object maintains non-managed resources. Relying on finalization for this object can cause memory leaks and exceptions within your application.

For an example of disposing managed objects, see Using the Managed Library.

The run time user interface for this control is a window with an opaque background (single color, picture background, or both) that contains opaque ink.

You can use the InkPicture control to render ink in Microsoft Windows 2000, Windows Server 2003, any edition of Windows XP, and any version of Windows Vista. However, you can input ink, accept gestures, or recognize handwriting only under the following conditions:

  • Ink can be input and recognized only if Tablet and Touch Technology is installed.

  • Gestures can be recognized only if Microsoft Gesture Recognizer is installed.

  • Handwriting can be recognized as text if the handwriting originated elsewhere and if recognizers are present.

If you use Windows 2000, Windows Server 2003, or any edition of Windows XP other than Tablet PC Edition, you can assign values to the ambient properties of the InkPicture control and copy and paste ink to other applications, but the value of its InkEnabled property is always false.

Persisted Ink objects can be loaded and displayed on all editions of Windows XP (including the Tablet PC Edition). However, the Ink objects can be converted to text (recognized) only if Windows XP Tablet PC Edition is installed.

For more information about ink controls, see Ink Controls.

For information about which threads raise particular events, see Threads on Which an Event Can Fire.

To improve your application's performance, manually dispose of an InkPicture control when it is no longer needed.

Security Note   If using under partial trust, this class and all its methods require SafeTopLevelWindows permission. See Security and Trust for more information.

Inheritance Hierarchy

System.Object
  System.MarshalByRefObject
    System.ComponentModel.Component
      System.Windows.Forms.Control
        System.Windows.Forms.PictureBox
          Microsoft.Ink.InkPicture

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

InkPicture Members

Microsoft.Ink Namespace

InkOverlay

Other Resources

Ink Controls

Threads on Which an Event Can Fire