title: Using Digital Ink in PowerPoint .NET
body: <p>I was wondering how PowerPoint slides can be automatically annotated using digital ink in .NET (using c#). Currently, I'm doing the same thing using free-form shapes, which is straightforward but has some issues. When selecting Office.MsoEditingType.msoEditingAuto as an editing type, the free-forms are smooth, but when constructing them and then converting into a shape (when consisting of more than a couple of points) takes a very long time (the following method would take ca 5s!)</p>
  
  <pre><code>            PowerPoint.Shape Shape = builder.ConvertToShape();
  </code></pre>
  
  <p>When using Office.MsoEditingType.msoEditingCorner, the shape is generated much quicker, but the resulting shapes are jagged (surprise!). </p>
  
  <p>I found the following code sample for doing the same using digital ink: </p>
  
  <pre><code>            DrawingAttributes drawingAttributes1 = new DrawingAttributes();
              drawingAttributes1.Color = Colors.Green;
  
              StylusPoint stylusPoint1 = new StylusPoint(100, 100);
              StylusPoint stylusPoint2 = new StylusPoint(100, 200);
              StylusPoint stylusPoint3 = new StylusPoint(200, 200);
              StylusPoint stylusPoint4 = new StylusPoint(200, 100);
              StylusPoint stylusPoint5 = new StylusPoint(100, 100);
  
              StylusPointCollection points = new StylusPointCollection(
                  new StylusPoint[] { stylusPoint1, stylusPoint2, stylusPoint3, 
                      stylusPoint4, stylusPoint5 });
  
              Stroke newStroke = new Stroke(points, drawingAttributes1);
  
              InkPresenter inkPres = new InkPresenter();
              inkPres.Strokes.Add(newStroke);
  </code></pre>
  
  <p>However, not being a PowerPoint Add-in expert (hardly even a beginner, actually), I don't know how to attach the inkpresenter to the current slide. Ideally, a new inkpresenter would be created &amp; kept per slide (so I don't have to worry about re-drawing on each slide navigation)</p>
  
  <p>I understood it's possible to create an ink canvas using the designer, and then drawing on that, but would that canvas then be attached to the entire presentation or just the current slide? And would it allow users to draw on the canvas (which is not the goal; drawing would be done automatically)?</p>
  
  <p>I spent quite some time looking for relevant code samples, but none of them seemed to do what I am intending. For instance, as mentioned, I'm not planning to allow users to draw on the slide, but automatically annotating the slide.</p>
  
  <p>Thanks,</p>
  
  <p>William</p>