none
Using Digital Ink in a PowerPoint .NET Add-in RRS feed

  • Question

  • Hello everyone,

    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!)

                PowerPoint.Shape Shape = builder.ConvertToShape();

    When using Office.MsoEditingType.msoEditingCorner, the shape is generated much quicker, but the resulting shapes are jagged (surprise!).

    I found the following code sample for doing the same using digital ink:

                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);

    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 & kept per slide (so I don't have to worry about re-drawing on each slide navigation)

    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)?

    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.

    Thanks,

    William
    Sunday, November 2, 2014 4:37 PM

Answers

  • Hi William,
    Thanks for posting in MSDN forum.

    What dis you mean digital ink in .NET? Does it mean WPF Digtal Ink?

    As far as I know, the PowerPoint supports the digtal ink but it not supported in programming level. You can get more detail about it from link below:
    http://www.microsoft.com/hardware/en-in/help/windows-8/how-to/mouse/use-digitalink-mouse

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, November 4, 2014 7:06 AM
    Moderator
  • Hi William,

    Hi Fei,

    Thanks for the reply. Yes, that is the digital ink I'm talking about. It's unfortunate that it's not exposed in PowerPoint.. 

    Regards,

    William

    If you want PowerPoint object model to exposed this feature, I suggest that you submit feedback from link below:
    Submit Feedback - Microsoft Office

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, November 10, 2014 9:25 AM
    Moderator

All replies

  • Hi William,
    Thanks for posting in MSDN forum.

    What dis you mean digital ink in .NET? Does it mean WPF Digtal Ink?

    As far as I know, the PowerPoint supports the digtal ink but it not supported in programming level. You can get more detail about it from link below:
    http://www.microsoft.com/hardware/en-in/help/windows-8/how-to/mouse/use-digitalink-mouse

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, November 4, 2014 7:06 AM
    Moderator
  • Hi Fei,

    Thanks for the reply. Yes, that is the digital ink I'm talking about. It's unfortunate that it's not exposed in PowerPoint.. 

    Regards,

    William

    Saturday, November 8, 2014 9:53 PM
  • Hi William,

    Hi Fei,

    Thanks for the reply. Yes, that is the digital ink I'm talking about. It's unfortunate that it's not exposed in PowerPoint.. 

    Regards,

    William

    If you want PowerPoint object model to exposed this feature, I suggest that you submit feedback from link below:
    Submit Feedback - Microsoft Office

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, November 10, 2014 9:25 AM
    Moderator