B
benmca
Hi -
I'm trying to query for ink in a certain region of a page within
OneNote. My query works ok, and I end up iterating through InkWords,
gathering ink as I go. My strategy was to build a primary Ink object,
adding ink from each InkWord to it as I go. Some pseudocode:
XmlNodeList dataNodes = parentNode.SelectNodes("//oneata", xmlns);
Ink ink = new Ink();
foreach(XmlNode node in dataNodes)
{
string encodedInk = node.InnerText;
Ink tempInk = DecodeInk(encodedInk);
primaryInk.AddStrokesAtRectangle(s, r);
}
Within Decode Ink, I do the following:
Ink ink = new Ink();
ink.Load(Convert.FromBase64String(encodedInk));
return ink;
The problem is this: When I call Ink.Load, the ink object throws an
exception:
Catastrophic failure (Exception from HRESULT: 0x8000FFFF
(E_UNEXPECTED))
As far as I know, this only happens when the ink is in a format which
the Ink object does not understand. I tried changing my ink.Load call
to
ink.Load("base64:" + Convert.FromBase64String(encodedInk));
....but got the same result.
Is the Ink for an InkDrawing encoded differently after IA (conversion
to InkWord)? I noticed a difference in the data, but assumed it was
normalizing strokes or something, no re-encoding data. Thanks for any
help!
Ben
I'm trying to query for ink in a certain region of a page within
OneNote. My query works ok, and I end up iterating through InkWords,
gathering ink as I go. My strategy was to build a primary Ink object,
adding ink from each InkWord to it as I go. Some pseudocode:
XmlNodeList dataNodes = parentNode.SelectNodes("//oneata", xmlns);
Ink ink = new Ink();
foreach(XmlNode node in dataNodes)
{
string encodedInk = node.InnerText;
Ink tempInk = DecodeInk(encodedInk);
primaryInk.AddStrokesAtRectangle(s, r);
}
Within Decode Ink, I do the following:
Ink ink = new Ink();
ink.Load(Convert.FromBase64String(encodedInk));
return ink;
The problem is this: When I call Ink.Load, the ink object throws an
exception:
Catastrophic failure (Exception from HRESULT: 0x8000FFFF
(E_UNEXPECTED))
As far as I know, this only happens when the ink is in a format which
the Ink object does not understand. I tried changing my ink.Load call
to
ink.Load("base64:" + Convert.FromBase64String(encodedInk));
....but got the same result.
Is the Ink for an InkDrawing encoded differently after IA (conversion
to InkWord)? I noticed a difference in the data, but assumed it was
normalizing strokes or something, no re-encoding data. Thanks for any
help!
Ben