├── LICENSES
├── stix.pdf
└── inter.txt
├── Demo
├── StoreLogo.ico
├── App.config
├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── App.xaml.cs
├── MyCertificate.cs
├── ImportDialog.xaml
├── ImportDialog.xaml.cs
├── TypeOfContentDialog.xaml
├── TypeOfContentDialog.xaml.cs
├── App.xaml
├── MyScript.InteractiveInk.Demo.Wpf.csproj
└── MainWindow.xaml
├── GetStarted
├── StoreLogo.ico
├── App.config
├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── App.xaml.cs
├── MyCertificate.cs
├── MainWindow.xaml
├── App.xaml
├── MainWindow.xaml.cs
└── MyScript.InteractiveInk.GetStarted.Wpf.csproj
├── fonts
├── MyScriptInter-Bold.otf
├── STIXTwoMath-Regular.otf
├── STIXTwoText-Italic.otf
└── MyScriptInter-Regular.otf
├── CONTRIBUTING.md
├── LICENSE
├── configurations
├── Raw Content
│ ├── drawing.json
│ └── text_math_shape.json
└── interactivity.json
├── UIReferenceImplementation
├── LayerControl.cs
├── Properties
│ └── AssemblyInfo.cs
├── UserControls
│ ├── EditorUserControl.xaml
│ └── SmartGuideUserControl.xaml
├── Path.cs
├── ResourceDictionary.xaml
├── ImagePainter.cs
├── MyScript.InteractiveInk.UIReferenceImplementation.Wpf.csproj
├── ImageLoader.cs
├── DisplayResolution.cs
├── FontMetricsProvider.cs
└── Canvas.cs
├── MyScript.InteractiveInk.Examples.Wpf.sln
├── README.md
├── getRecognitionAssets.ps1
├── .gitattributes
└── .gitignore
/LICENSES/stix.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyScript/interactive-ink-examples-wpf/HEAD/LICENSES/stix.pdf
--------------------------------------------------------------------------------
/Demo/StoreLogo.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyScript/interactive-ink-examples-wpf/HEAD/Demo/StoreLogo.ico
--------------------------------------------------------------------------------
/GetStarted/StoreLogo.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyScript/interactive-ink-examples-wpf/HEAD/GetStarted/StoreLogo.ico
--------------------------------------------------------------------------------
/fonts/MyScriptInter-Bold.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyScript/interactive-ink-examples-wpf/HEAD/fonts/MyScriptInter-Bold.otf
--------------------------------------------------------------------------------
/fonts/STIXTwoMath-Regular.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyScript/interactive-ink-examples-wpf/HEAD/fonts/STIXTwoMath-Regular.otf
--------------------------------------------------------------------------------
/fonts/STIXTwoText-Italic.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyScript/interactive-ink-examples-wpf/HEAD/fonts/STIXTwoText-Italic.otf
--------------------------------------------------------------------------------
/fonts/MyScriptInter-Regular.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MyScript/interactive-ink-examples-wpf/HEAD/fonts/MyScriptInter-Regular.otf
--------------------------------------------------------------------------------
/Demo/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/GetStarted/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Demo/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/GetStarted/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Demo/App.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright @ MyScript. All rights reserved.
2 |
3 | using System.Windows;
4 |
5 | namespace MyScript.IInk.Demo
6 | {
7 | ///
8 | /// Interaction logic for App.xaml
9 | ///
10 | public partial class App : Application
11 | {
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/GetStarted/App.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright @ MyScript. All rights reserved.
2 |
3 | using System.Windows;
4 |
5 | namespace MyScript.IInk.GetStarted
6 | {
7 | ///
8 | /// Interaction logic for App.xaml
9 | ///
10 | public partial class App : Application
11 | {
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | We gladly welcome pull requests. If you have any questions, or want help solving a problem, feel free to stop by the [#MyScript forum](https://developer.myscript.com/support/).
4 |
5 | ## License
6 |
7 | Those examples are licensed under the [Apache 2.0](https://opensource.org/license/apache-2-0).
8 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright MyScript.
2 | Licensed under the Apache License, Version 2.0 (the "License");
3 | you may not use this file except in compliance with the License.
4 | You may obtain a copy of the License at
5 | http://www.apache.org/licenses/LICENSE-2.0
6 | Unless required by applicable law or agreed to in writing, software
7 | distributed under the License is distributed on an "AS IS" BASIS,
8 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9 | See the License for the specific language governing permissions and
10 | limitations under the License.
11 |
--------------------------------------------------------------------------------
/Demo/MyCertificate.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * MyCertificate.cs
3 | * Replace this file with with the one you received by mail when you registered
4 | * as a developer on https://developer.myscript.com.
5 | */
6 | namespace MyScript.Certificate
7 | {
8 | public sealed class MyCertificate
9 | {
10 | public static sbyte[] Bytes
11 | {
12 | get
13 | {
14 | throw new System.Exception("Please replace the content of MyCertificate.cs with the certificate you received from the developer portal");
15 | }
16 | }
17 |
18 | } // end of: class MyCertificate
19 |
20 | } // end of: namespace
21 |
--------------------------------------------------------------------------------
/GetStarted/MyCertificate.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * MyCertificate.cs
3 | * Replace this file with with the one you received by mail when you registered
4 | * as a developer on https://developer.myscript.com.
5 | */
6 | namespace MyScript.Certificate
7 | {
8 | public sealed class MyCertificate
9 | {
10 | public static sbyte[] Bytes
11 | {
12 | get
13 | {
14 | throw new System.Exception("Please replace the content of MyCertificate.cs with the certificate you received from the developer portal");
15 | }
16 | }
17 |
18 | } // end of: class MyCertificate
19 |
20 | } // end of: namespace
21 |
--------------------------------------------------------------------------------
/configurations/Raw Content/drawing.json:
--------------------------------------------------------------------------------
1 | {
2 | "raw-content": {
3 | "line-pattern": "none",
4 | "recognition": {
5 | "types": [ ]
6 | },
7 | "classification": {
8 | "types": [ ]
9 | },
10 | "convert": {
11 | "shape-on-hold": false
12 | },
13 | "shape": {
14 | "snap-axis": [ ]
15 | },
16 | "interactive-blocks": {
17 | "auto-classified": [ ]
18 | },
19 | "eraser": {
20 | "erase-precisely": true,
21 | "dynamic-radius": true
22 | },
23 | "auto-connection": false,
24 | "guides": {
25 | "show": [ ],
26 | "snap": [ ]
27 | },
28 | "pen": {
29 | "gestures": [ ]
30 | },
31 | "rotation": [ "image" ]
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Demo/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace MyScript.IInk.Demo.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/GetStarted/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace MyScript.IInk.GetStarted.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/configurations/interactivity.json:
--------------------------------------------------------------------------------
1 | {
2 | "diagram": {
3 | "configuration": {
4 | "analyzer": {
5 | "bundle": "raw-content",
6 | "name": "text-block"
7 | }
8 | }
9 | },
10 | "raw-content": {
11 | "configuration": {
12 | "analyzer": {
13 | "bundle": "raw-content",
14 | "name": "text-block"
15 | },
16 | "math": {
17 | "bundle": "math",
18 | "name": "standard"
19 | }
20 | },
21 | "classification": {
22 | "types": [ "text", "drawing" ]
23 | },
24 | "recognition": {
25 | "types": [ "text", "math" ]
26 | },
27 | "convert": {
28 | "shape-on-hold": true
29 | },
30 | "shape": {
31 | "snap-axis": [ "triangle", "rectangle", "rhombus", "parallelogram", "ellipse" ]
32 | },
33 | "eraser": {
34 | "erase-precisely": false,
35 | "dynamic-radius": true
36 | },
37 | "auto-connection": true,
38 | "interactive-blocks": {
39 | "feedback": [ "math" ]
40 | },
41 | "pen": {
42 | "gestures": [ "underline", "scratch-out", "strike-through" ]
43 | },
44 | "line-pattern": "grid",
45 | "guides": {
46 | "show": [ "alignment", "text", "square", "square-inside", "image-aspect-ratio", "rotation" ],
47 | "snap": [ "alignment", "text", "square", "square-inside", "image-aspect-ratio", "rotation" ]
48 | }
49 | }
50 | }
--------------------------------------------------------------------------------
/UIReferenceImplementation/LayerControl.cs:
--------------------------------------------------------------------------------
1 | // Copyright @ MyScript. All rights reserved.
2 |
3 | using System;
4 | using System.Windows.Controls;
5 | using System.Windows.Media;
6 |
7 | namespace MyScript.IInk.UIReferenceImplementation
8 | {
9 | public class LayerControl : Label
10 | {
11 | public Renderer Renderer { get; set; }
12 | public ImageLoader ImageLoader { get; set; }
13 |
14 | /// Redraw the Layer Control
15 | protected override void OnRender(DrawingContext drawingContext)
16 | {
17 | base.OnRender(drawingContext);
18 |
19 | if (Renderer != null)
20 | {
21 | int x = 0;
22 | int y = 0;
23 | int width = (int)Math.Round(ActualWidth);
24 | int height = (int)Math.Round(ActualHeight);
25 | float pixelsPerDip = (float)DisplayResolution.GetPixelsPerDip(this);
26 | Canvas canvas = new Canvas(drawingContext, pixelsPerDip, ImageLoader);
27 |
28 | Renderer.DrawModel(x, y, width, height, canvas);
29 | Renderer.DrawCaptureStrokes(x, y, width, height, canvas);
30 | }
31 | }
32 |
33 | /// Force to redraw the Layer Control
34 | public void Update()
35 | {
36 | this.Dispatcher.BeginInvoke(new Action(() =>
37 | {
38 | this.InvalidateVisual();
39 | }));
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/UIReferenceImplementation/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("MyScript.InteractiveInk.UIReferenceImplementation.Wpf")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("MyScript")]
12 | [assembly: AssemblyProduct("MyScript.InteractiveInk.UIReferenceImplementation.Wpf")]
13 | [assembly: AssemblyCopyright("Copyright @ MyScript. All rights reserved.")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("8ed3cb31-d4b5-4b82-8c15-f6c31bbe520d")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("4.2.1.0")]
36 | [assembly: AssemblyFileVersion("4.2.1.0")]
37 |
--------------------------------------------------------------------------------
/configurations/Raw Content/text_math_shape.json:
--------------------------------------------------------------------------------
1 | {
2 | "raw-content": {
3 | "configuration": {
4 | "analyzer": {
5 | "bundle": "raw-content2",
6 | "name": "standard"
7 | },
8 | "math": {
9 | "bundle": "math2",
10 | "name": "standard"
11 | }
12 | },
13 | "classification": {
14 | "types": [ "text", "shape", "math", "drawing" ]
15 | },
16 | "recognition": {
17 | "types": [ "text", "shape", "math" ]
18 | },
19 | "convert": {
20 | "shape-on-hold": true
21 | },
22 | "shape": {
23 | "snap-axis": [ ]
24 | },
25 | "eraser": {
26 | "erase-precisely": false,
27 | "dynamic-radius": true
28 | },
29 | "auto-connection": false,
30 | "edge": {
31 | "policy": [ ]
32 | },
33 | "interactive-blocks": {
34 | "auto-classified": [ "text", "math", "shape" ],
35 | "feedback": [ "text", "math" ],
36 | "feedback-hints": [ "text", "math" ]
37 | },
38 | "pen": {
39 | "gestures": [ "scratch-out", "strike-through" ]
40 | },
41 | "line-pattern": "grid",
42 | "guides": {
43 | "show": [ "alignment", "text", "square", "square-inside", "image-aspect-ratio", "rotation" ],
44 | "snap": [ "alignment", "text", "square", "square-inside", "image-aspect-ratio", "rotation" ]
45 | }
46 | },
47 | "convert": {
48 | "convert-on-double-tap": false
49 | },
50 | "math": {
51 | "solver": {
52 | "options": "algebraic",
53 | "numerical-computation": [ "at-right-of-equal-sign", "at-question-mark" ],
54 | "enable-syntactic-correction": false,
55 | "display-implicit-multiply": false,
56 | "auto-variable-management": {
57 | "enable": true,
58 | "scoping-policy": "closest"
59 | }
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/Demo/ImportDialog.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
19 |
20 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/UIReferenceImplementation/UserControls/EditorUserControl.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/Demo/ImportDialog.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright @ MyScript. All rights reserved.
2 |
3 | using System.Windows;
4 | using System.Windows.Controls;
5 |
6 | namespace MyScript.IInk.Demo
7 | {
8 | ///
9 | /// Interaction logic for ImportDialog.xaml
10 | ///
11 | partial class ImportDialog : Window
12 | {
13 |
14 | public ImportDialog(Window parent, string title, MimeType[] mimeTypes)
15 | {
16 | InitializeComponent();
17 |
18 | Owner = parent;
19 | Title = title;
20 |
21 | WrappingCheckBox.IsChecked = true; // call WrappingCheckBox_Toggle
22 | ResultTextBox.Text = "";
23 |
24 | MimeTypeComboBox.Items.Clear();
25 | foreach (var mimeType in mimeTypes)
26 | MimeTypeComboBox.Items.Add(MimeTypeF.GetTypeName(mimeType));
27 |
28 | MimeTypeComboBox.SelectedIndex = 0;
29 | }
30 |
31 | public string ResultText
32 | {
33 | get { return ResultTextBox.Text; }
34 | set { ResultTextBox.Text = value; }
35 | }
36 |
37 | public int SelectedMimeType
38 | {
39 | get { return MimeTypeComboBox.SelectedIndex; }
40 | }
41 |
42 | private void OK_Click(object sender, RoutedEventArgs e)
43 | {
44 | DialogResult = true;
45 | }
46 |
47 | private void Cancel_Click(object sender, RoutedEventArgs e)
48 | {
49 | DialogResult = false;
50 | }
51 |
52 | private void WrappingCheckBox_Toggle(object sender, RoutedEventArgs e)
53 | {
54 | var checkBox = sender as CheckBox;
55 | var isChecked = (bool)checkBox.IsChecked;
56 |
57 | ResultTextBox.TextWrapping = (isChecked ? TextWrapping.Wrap : TextWrapping.NoWrap);
58 | ResultTextBox.HorizontalScrollBarVisibility = (isChecked ? ScrollBarVisibility.Hidden : ScrollBarVisibility.Auto);
59 | ResultTextBox.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/MyScript.InteractiveInk.Examples.Wpf.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.6.33723.286
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyScript.InteractiveInk.GetStarted.Wpf", "GetStarted\MyScript.InteractiveInk.GetStarted.Wpf.csproj", "{5D7ED6D6-673A-4F5A-91AF-2D037563DEDE}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyScript.InteractiveInk.UIReferenceImplementation.Wpf", "UIReferenceImplementation\MyScript.InteractiveInk.UIReferenceImplementation.Wpf.csproj", "{8ED3CB31-D4B5-4B82-8C15-F6C31BBE520D}"
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyScript.InteractiveInk.Demo.Wpf", "Demo\MyScript.InteractiveInk.Demo.Wpf.csproj", "{B3222351-CDD3-42A7-9AD3-36E8D6322AEC}"
11 | EndProject
12 | Global
13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
14 | Debug|x64 = Debug|x64
15 | Release|x64 = Release|x64
16 | EndGlobalSection
17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
18 | {5D7ED6D6-673A-4F5A-91AF-2D037563DEDE}.Debug|x64.ActiveCfg = Debug|x64
19 | {5D7ED6D6-673A-4F5A-91AF-2D037563DEDE}.Debug|x64.Build.0 = Debug|x64
20 | {5D7ED6D6-673A-4F5A-91AF-2D037563DEDE}.Release|x64.ActiveCfg = Release|x64
21 | {5D7ED6D6-673A-4F5A-91AF-2D037563DEDE}.Release|x64.Build.0 = Release|x64
22 | {8ED3CB31-D4B5-4B82-8C15-F6C31BBE520D}.Debug|x64.ActiveCfg = Debug|x64
23 | {8ED3CB31-D4B5-4B82-8C15-F6C31BBE520D}.Debug|x64.Build.0 = Debug|x64
24 | {8ED3CB31-D4B5-4B82-8C15-F6C31BBE520D}.Release|x64.ActiveCfg = Release|x64
25 | {8ED3CB31-D4B5-4B82-8C15-F6C31BBE520D}.Release|x64.Build.0 = Release|x64
26 | {B3222351-CDD3-42A7-9AD3-36E8D6322AEC}.Debug|x64.ActiveCfg = Debug|x64
27 | {B3222351-CDD3-42A7-9AD3-36E8D6322AEC}.Debug|x64.Build.0 = Debug|x64
28 | {B3222351-CDD3-42A7-9AD3-36E8D6322AEC}.Release|x64.ActiveCfg = Release|x64
29 | {B3222351-CDD3-42A7-9AD3-36E8D6322AEC}.Release|x64.Build.0 = Release|x64
30 | EndGlobalSection
31 | GlobalSection(SolutionProperties) = preSolution
32 | HideSolutionNode = FALSE
33 | EndGlobalSection
34 | GlobalSection(ExtensibilityGlobals) = postSolution
35 | SolutionGuid = {05711AAC-3C70-4850-B3C7-9086E12F9EA1}
36 | EndGlobalSection
37 | EndGlobal
38 |
--------------------------------------------------------------------------------
/UIReferenceImplementation/Path.cs:
--------------------------------------------------------------------------------
1 | // Copyright @ MyScript. All rights reserved.
2 |
3 | using System.Windows;
4 | using System.Windows.Media;
5 |
6 | namespace MyScript.IInk.UIReferenceImplementation
7 | {
8 | class RenderPath : MyScript.IInk.Graphics.IPath
9 | {
10 | private PathGeometry _path;
11 | PathFigure _figure;
12 |
13 | public RenderPath()
14 | {
15 | _path = new PathGeometry();
16 | _figure = null;
17 | }
18 |
19 | public PathGeometry FinalizeGeometry()
20 | {
21 | if (_figure != null)
22 | {
23 | _path.Figures.Add(_figure);
24 | _figure = null;
25 | }
26 | return _path;
27 | }
28 |
29 | public uint UnsupportedOperations
30 | {
31 | get { return (uint)MyScript.IInk.Graphics.PathOperation.ARC_OPS; }
32 | }
33 |
34 | public void MoveTo(float x, float y)
35 | {
36 | if (_figure != null)
37 | _path.Figures.Add(_figure);
38 | _figure = new PathFigure();
39 | _figure.StartPoint = new Point(x, y);
40 | }
41 |
42 | public void LineTo(float x, float y)
43 | {
44 | _figure.Segments.Add(new LineSegment(new Point(x, y), false));
45 | }
46 |
47 | public void CurveTo(float x1, float y1, float x2, float y2, float x, float y)
48 | {
49 | _figure.Segments.Add(new BezierSegment(new Point(x1, y1), new Point(x2, y2), new Point(x, y), false));
50 | }
51 |
52 | public void QuadTo(float x1, float y1, float x, float y)
53 | {
54 | _figure.Segments.Add(new QuadraticBezierSegment(new Point(x1, y1), new Point(x, y), false));
55 | }
56 |
57 | public void ArcTo(float rx, float ry, float phi, bool fA, bool fS, float x, float y)
58 | {
59 | _figure.Segments.Add(new ArcSegment(new Point(x, y), new Size(rx, ry), phi, fA, fS ? SweepDirection.Clockwise : SweepDirection.Counterclockwise, false));
60 | }
61 |
62 | public void ClosePath()
63 | {
64 | if (!_figure.IsClosed)
65 | _figure.Segments.Add(new LineSegment(_figure.StartPoint, false));
66 | _path.Figures.Add(_figure);
67 | _figure = null;
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/Demo/TypeOfContentDialog.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
17 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/Demo/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("MyScript.InteractiveInk.Demo.Wpf")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("MyScript")]
14 | [assembly: AssemblyProduct("MyScript.InteractiveInk.Demo.Wpf")]
15 | [assembly: AssemblyCopyright("Copyright @ MyScript. All rights reserved.")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("4.2.1.0")]
55 | [assembly: AssemblyFileVersion("4.2.1.0")]
56 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## What is it about?
2 |
3 | Interactive Ink SDK is the best way to integrate handwriting recognition capabilities into your WPF application. Interactive Ink extends digital ink to allow users to more intuitively create, interact with, and share content in digital form. Handwritten text, mathematical equations or even diagrams are interpreted in real-time to be editable via simple gestures, responsive and easy to convert to a neat output.
4 |
5 | This repository contains a "get started" example, a complete example and a reference implementation of the WPF integration part that developers using Interactive Ink SDK can reuse inside their projects. All of those are written in C# and XAML.
6 |
7 | The repository content targets WPF platform.
8 |
9 | ## Getting started
10 |
11 | ### Installation
12 |
13 | 1. Clone the examples repository `git clone https://github.com/MyScript/interactive-ink-examples-wpf.git`
14 |
15 | 2. Claim a certificate to receive the free license to start develop your application by following the first steps of [Getting Started](https://developer.myscript.com/getting-started)
16 |
17 | 3. Copy this certificate to `GetStarted\MyCertificate.cs` and `Demo\MyCertificate.cs`
18 |
19 | 4. Open `MyScript.InteractiveInk.Examples.Wpf.sln` file. `GetStarted` project is the most simple example and is design to help you understand what Interactive Ink is about and how easy it is to integrate it into your application. `Demo` project contains a complete example and helps you build your own integration. You can select which project to launch by right-clicking the project in the solution browser and selecting "Set as startup project".
20 |
21 | ## Building your own integration
22 |
23 | In your application add the dependency to `MyScript.InteractiveInk.Wpf` nuget. Also copy `UIReferenceImplementation` directory into your project. More details available in the [developer guide](https://developer.myscript.com/docs/interactive-ink/1.0/windows/).
24 |
25 | ## Documentation
26 |
27 | A complete guide is available on [MyScript Developer website](https://developer.myscript.com/docs/interactive-ink/latest/windows/).
28 |
29 | The API Reference is available in Visual Studio as soon as the Nugets packages are downloaded.
30 |
31 | ## Getting support
32 |
33 | You can get some support from the dedicated section on [MyScript Developer website](https://devportal.corp.myscript.com/support/).
34 |
35 | ## Sharing your feedback ?
36 |
37 | Made a cool app with Interactive Ink? Ready to cross join our marketing efforts? We would love to hear about you!
38 | We’re planning to showcase apps using it so let us know by sending a quick mail to [myapp@myscript.com](mailto://myapp@myscript.com).
39 |
--------------------------------------------------------------------------------
/GetStarted/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("MyScript.InteractiveInk.GetStarted.Wpf")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("MyScript")]
14 | [assembly: AssemblyProduct("MyScript.InteractiveInk.GetStarted.Wpf")]
15 | [assembly: AssemblyCopyright("Copyright @ MyScript. All rights reserved.")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("4.2.1.0")]
55 | [assembly: AssemblyFileVersion("4.2.1.0")]
56 |
--------------------------------------------------------------------------------
/UIReferenceImplementation/ResourceDictionary.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/GetStarted/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/Demo/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace MyScript.IInk.Demo.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MyScript.IInk.Demo.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/GetStarted/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace MyScript.IInk.GetStarted.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MyScript.IInk.GetStarted.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/GetStarted/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
18 |
19 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/Demo/TypeOfContentDialog.xaml.cs:
--------------------------------------------------------------------------------
1 | // Copyright @ MyScript. All rights reserved.
2 |
3 | using System.Collections.Generic;
4 | using System.Windows;
5 | using System.Windows.Controls;
6 | using MyScript.IInk.UIReferenceImplementation;
7 |
8 | namespace MyScript.IInk.Demo
9 | {
10 | ///
11 | /// Interaction logic for TypeOfContentDialog.xaml
12 | ///
13 | public partial class TypeOfContentDialog : UserControl
14 | {
15 | public TypeOfContentDialog()
16 | {
17 | InitializeComponent();
18 | Visibility = Visibility.Hidden;
19 | }
20 |
21 | private string _result = string.Empty;
22 | private bool _newPackage = true;
23 | private bool _cancelable = false;
24 | private UIElement _parent;
25 | public delegate void AddNewPartHandler(string partType, bool newPackage);
26 | public event AddNewPartHandler AddNewPart;
27 |
28 | public string ShowHandlerDialog(string[] supportedPartTypes, bool newPackage, bool cancelable)
29 | {
30 | Visibility = Visibility.Visible;
31 |
32 | _parent.IsEnabled = false;
33 | _newPackage = newPackage;
34 | _cancelable = cancelable;
35 |
36 | Close.IsEnabled = _cancelable;
37 | Close.Visibility = _cancelable ? Visibility.Visible : Visibility.Hidden;
38 |
39 | List