0

How to render ink on screen using DierctX?

I am aware of InkManager in C# for rendering ink on canvas. I am trying to do similar functionality using SharpDX. But I don't have any sample code to refer.

Is there any tutorial or sample code which explains about rendering ink using directX? Anything is ok, either C++ or C#

leesei
  • 6,020
  • 2
  • 29
  • 51
ashish nirkhe
  • 689
  • 3
  • 10
  • 22
  • What exactly do you understand under rendering ink? There are several ways ink could look like. Do you have some examples? I don't know the InkManager. – Nico Schertler May 14 '13 at 08:56
  • @NicoSchertler with rendering ink I was referring to something like touch based coloring or mouse pointer movement based drawing on screen. InkManager in C# provides properties and methods to manage the input, manipulation, and processing (including handwriting recognition) of one or more InkStroke objects. I am trying to mimic such functionality using SharpDX. – ashish nirkhe May 14 '13 at 18:50
  • Recognition is a wide field. Neural networks can be used for that. If you just want to draw a line, you can render a line strip. If you want to draw lines thicker than 1 px, you can either draw multiple strips or rasterize the lines yourself (see Bresenham's algorithm for line rasterization). – Nico Schertler May 14 '13 at 21:58

2 Answers2

0

The closest technology in DirectX that would provide a basic infrastructure for "Ink rendering" would be Direct2D. This is probably what "InkManager" is using internally, at least for the drawing part. There is no "handwriting recognition" in Direct2D. But as Direct2D is a low level API, you will have to manage lots of details.

There are dozens of samples in SharpDX with Direct2D (either samples on Desktop - where the drawing part is still valid on WinRT, or plain WinRT), but you will not have a direct "Ink" samples, so you will have to dig into this yourself.

Also, the only source of information for Direct2D is msdn. There is no book and very view tutorials about this API.

xoofx
  • 3,682
  • 1
  • 17
  • 32
0

Have a look at: http://code.msdn.microsoft.com/windowsapps/XAML-SwapChainPanel-00cb688b

Specifically scenarios 2 and 4. I have used this example to render and scale inkstrokes from C#.

Glenn Sandoval
  • 233
  • 1
  • 10